Skip to content
This repository has been archived by the owner on Sep 21, 2022. It is now read-only.

Commit

Permalink
Adding in support for MariaDB 10.3
Browse files Browse the repository at this point in the history
Signed-off-by: Dan Kozlowski <koz@planetscale.com>
  • Loading branch information
Dan Kozlowski committed Sep 10, 2018
1 parent 72f2a00 commit 0d54495
Show file tree
Hide file tree
Showing 7 changed files with 69 additions and 18 deletions.
18 changes: 0 additions & 18 deletions config/mycnf/default.cnf
Original file line number Diff line number Diff line change
Expand Up @@ -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}}
Expand Down Expand Up @@ -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

17 changes: 17 additions & 0 deletions config/mycnf/master_mariadb.cnf
Original file line number Diff line number Diff line change
@@ -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
21 changes: 21 additions & 0 deletions config/mycnf/master_mariadb103.cnf
Original file line number Diff line number Diff line change
@@ -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
16 changes: 16 additions & 0 deletions config/mycnf/master_mysql56.cnf
Original file line number Diff line number Diff line change
Expand Up @@ -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
3 changes: 3 additions & 0 deletions go/vt/vttest/environment.go
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
11 changes: 11 additions & 0 deletions py/vttest/mysql_flavor.py
Original file line number Diff line number Diff line change
Expand Up @@ -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."""
Expand Down Expand Up @@ -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:
Expand Down
1 change: 1 addition & 0 deletions test/mysql_flavor.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")

0 comments on commit 0d54495

Please sign in to comment.