Skip to content

Commit

Permalink
Merge pull request #5374 from planetscale/morgo-mariadb-10-4
Browse files Browse the repository at this point in the history
Add mysqlctl support for MariaDB 10.4
  • Loading branch information
sougou authored Nov 23, 2019
2 parents 08810cc + 7c7326a commit 6093fe7
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 0 deletions.
23 changes: 23 additions & 0 deletions config/mycnf/master_mariadb104.cnf
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# This file is auto-included when MariaDB 10.4 is detected.

# 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
6 changes: 6 additions & 0 deletions go/vt/mysqlctl/capabilityset.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,16 @@ func (c *capabilitySet) hasMySQLUpgradeInServer() bool {
func (c *capabilitySet) hasInitializeInServer() bool {
return c.isMySQLLike() && c.version.atLeast(serverVersion{Major: 5, Minor: 7, Patch: 0})
}
func (c *capabilitySet) hasMaria104InstallDb() bool {
return c.isMariaDB() && c.version.atLeast(serverVersion{Major: 10, Minor: 4, Patch: 0})
}

// IsMySQLLike tests if the server is either MySQL
// or Percona Server. At least currently, Vitess doesn't
// make use of any specific Percona Server features.
func (c *capabilitySet) isMySQLLike() bool {
return c.flavor == flavorMySQL || c.flavor == flavorPercona
}
func (c *capabilitySet) isMariaDB() bool {
return c.flavor == flavorMariaDB
}
3 changes: 3 additions & 0 deletions go/vt/mysqlctl/mysqld.go
Original file line number Diff line number Diff line change
Expand Up @@ -742,6 +742,9 @@ func (mysqld *Mysqld) installDataDir(cnf *Mycnf) error {
"--defaults-file=" + cnf.path,
"--basedir=" + mysqlBaseDir,
}
if mysqld.capabilities.hasMaria104InstallDb() {
args = append(args, "--auth-root-authentication-method=normal")
}
cmdPath, err := binaryPath(mysqlRoot, "mysql_install_db")
if err != nil {
return err
Expand Down

0 comments on commit 6093fe7

Please sign in to comment.