diff --git a/config/mycnf/default.cnf b/config/mycnf/default.cnf index dec456f303c..8e3bac4f4c8 100644 --- a/config/mycnf/default.cnf +++ b/config/mycnf/default.cnf @@ -22,7 +22,6 @@ innodb_log_file_size = 64M innodb_log_files_in_group = 2 innodb_log_group_home_dir = {{.InnodbLogGroupHomeDir}} innodb_max_dirty_pages_pct = 75 -innodb_support_xa = 0 innodb_thread_concurrency = 20 key_buffer_size = 32M log-error = {{.ErrorLogPath}} @@ -56,20 +55,3 @@ thread_cache_size = 200 tmpdir = {{.TmpDir}} tmp_table_size = 32M transaction-isolation = REPEATABLE-READ - -# Semi-sync replication is required for automated unplanned failover -# (when the master goes away). Here we just load the plugin so it's -# available if desired, but it's disabled at startup. -# -# If the -enable_semi_sync flag is used, VTTablet will enable semi-sync -# at the proper time when replication is set up, or when masters are -# promoted or demoted. -plugin-load = rpl_semi_sync_master=semisync_master.so;rpl_semi_sync_slave=semisync_slave.so - -# When semi-sync is enabled, don't allow fallback to async -# if you get no ack, or have no slaves. This is necessary to -# prevent alternate futures when doing a failover in response to -# a master that becomes unresponsive. -rpl_semi_sync_master_timeout = 1000000000000000000 -rpl_semi_sync_master_wait_no_slave = 1 - diff --git a/config/mycnf/master_mariadb.cnf b/config/mycnf/master_mariadb.cnf index b76a7816a8a..83f6f318e4c 100644 --- a/config/mycnf/master_mariadb.cnf +++ b/config/mycnf/master_mariadb.cnf @@ -1,3 +1,20 @@ # enable strict mode so it's safe to compare sequence numbers across different server IDs. gtid_strict_mode = 1 innodb_stats_persistent = 0 +innodb_support_xa = 0 + +# Semi-sync replication is required for automated unplanned failover +# (when the master goes away). Here we just load the plugin so it's +# available if desired, but it's disabled at startup. +# +# If the -enable_semi_sync flag is used, VTTablet will enable semi-sync +# at the proper time when replication is set up, or when masters are +# promoted or demoted. +plugin-load = rpl_semi_sync_master=semisync_master.so;rpl_semi_sync_slave=semisync_slave.so + +# When semi-sync is enabled, don't allow fallback to async +# if you get no ack, or have no slaves. This is necessary to +# prevent alternate futures when doing a failover in response to +# a master that becomes unresponsive. +rpl_semi_sync_master_timeout = 1000000000000000000 +rpl_semi_sync_master_wait_no_slave = 1 diff --git a/config/mycnf/master_mariadb103.cnf b/config/mycnf/master_mariadb103.cnf new file mode 100644 index 00000000000..a4dfb50ab18 --- /dev/null +++ b/config/mycnf/master_mariadb103.cnf @@ -0,0 +1,21 @@ +# enable strict mode so it's safe to compare sequence numbers across different server IDs. +gtid_strict_mode = 1 +innodb_stats_persistent = 0 + +# Semi-sync replication is required for automated unplanned failover +# (when the master goes away). Here we just load the plugin so it's +# available if desired, but it's disabled at startup. +# +# If the -enable_semi_sync flag is used, VTTablet will enable semi-sync +# at the proper time when replication is set up, or when masters are +# promoted or demoted. + +# semi_sync has been merged into master as of mariadb 10.3 so this is no longer needed +#plugin-load = rpl_semi_sync_master=semisync_master.so;rpl_semi_sync_slave=semisync_slave.so + +# When semi-sync is enabled, don't allow fallback to async +# if you get no ack, or have no slaves. This is necessary to +# prevent alternate futures when doing a failover in response to +# a master that becomes unresponsive. +rpl_semi_sync_master_timeout = 1000000000000000000 +rpl_semi_sync_master_wait_no_slave = 1 diff --git a/config/mycnf/master_mysql56.cnf b/config/mycnf/master_mysql56.cnf index 2934975d751..2c802b2332a 100644 --- a/config/mycnf/master_mysql56.cnf +++ b/config/mycnf/master_mysql56.cnf @@ -13,3 +13,19 @@ relay_log_recovery = 1 # Native AIO tends to run into aio-max-nr limit during test startup. innodb_use_native_aio = 0 + +# Semi-sync replication is required for automated unplanned failover +# (when the master goes away). Here we just load the plugin so it's +# available if desired, but it's disabled at startup. +# +# If the -enable_semi_sync flag is used, VTTablet will enable semi-sync +# at the proper time when replication is set up, or when masters are +# promoted or demoted. +plugin-load = rpl_semi_sync_master=semisync_master.so;rpl_semi_sync_slave=semisync_slave.so + +# When semi-sync is enabled, don't allow fallback to async +# if you get no ack, or have no slaves. This is necessary to +# prevent alternate futures when doing a failover in response to +# a master that becomes unresponsive. +rpl_semi_sync_master_timeout = 1000000000000000000 +rpl_semi_sync_master_wait_no_slave = 1 diff --git a/go/vt/vttest/environment.go b/go/vt/vttest/environment.go index 05b3772b114..e2204714fcf 100644 --- a/go/vt/vttest/environment.go +++ b/go/vt/vttest/environment.go @@ -118,6 +118,9 @@ func GetMySQLOptions(flavor string) (string, []string, error) { mycnf := []string{"config/mycnf/vtcombo.cnf"} switch flavor { + case "MariaDB103": + mycnf = append(mycnf, "config/mycnf/default-fast.cnf") + mycnf = append(mycnf, "config/mycnf/master_mariadb103.cnf") case "MariaDB": mycnf = append(mycnf, "config/mycnf/default-fast.cnf") mycnf = append(mycnf, "config/mycnf/master_mariadb.cnf") diff --git a/py/vttest/mysql_flavor.py b/py/vttest/mysql_flavor.py index e0e8969ea80..2e9e3f95ff3 100644 --- a/py/vttest/mysql_flavor.py +++ b/py/vttest/mysql_flavor.py @@ -53,6 +53,15 @@ def my_cnf(self): ] return ":".join(files) +class MariaDB103(MysqlFlavor): + """Overrides specific to MariaDB 10.3""" + + def my_cnf(self): + files = [ + os.path.join(vttop, "config/mycnf/default-fast.cnf"), + os.path.join(vttop, "config/mycnf/master_mariadb103.cnf"), + ] + return ":".join(files) class MySQL56(MysqlFlavor): """Overrides specific to MySQL 5.6.""" @@ -89,6 +98,8 @@ def set_mysql_flavor(flavor): if flavor == "MariaDB": __mysql_flavor = MariaDB() + elif flavor == "MariaDB103": + __mysql_flavor = MariaDB103() elif flavor == "MySQL56": __mysql_flavor = MySQL56() else: diff --git a/test/mysql_flavor.py b/test/mysql_flavor.py index 33d13705c7d..dc14073a06e 100644 --- a/test/mysql_flavor.py +++ b/test/mysql_flavor.py @@ -230,4 +230,5 @@ def register_flavor(flavor, cls, env): flavor_map[flavor] = {"cls": cls, "env": env} register_flavor("MariaDB", MariaDB, "MariaDB") +register_flavor("MariaDB103", MariaDB, "MariaDB103") register_flavor("MySQL56", MySQL56, "MySQL56")