Skip to content

Commit 2eb3c33

Browse files
committed
add mysql84 support
1 parent 790517d commit 2eb3c33

File tree

3 files changed

+51
-1
lines changed

3 files changed

+51
-1
lines changed

config/embed.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,3 +16,6 @@ var MycnfMySQL57 string
1616

1717
//go:embed mycnf/mysql80.cnf
1818
var MycnfMySQL80 string
19+
20+
//go:embed mycnf/mysql84.cnf
21+
var MycnfMySQL84 string

config/mycnf/mysql84.cnf

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
# This file is auto-included when MySQL 8.4.0 or later is detected.
2+
3+
# all db instances should skip starting replication threads - that way we can do any
4+
# additional configuration (like enabling semi-sync) before we connect to
5+
# the source.
6+
skip_replica_start
7+
8+
# MySQL 8.0 enables binlog by default with sync_binlog and TABLE info repositories
9+
# It does not enable GTIDs or enforced GTID consistency
10+
11+
gtid_mode = ON
12+
enforce_gtid_consistency
13+
relay_log_recovery = 1
14+
binlog_expire_logs_seconds = 259200
15+
16+
# disable mysqlx
17+
mysqlx = 0
18+
19+
# 8.4 changes the default auth-plugin to caching_sha2_password and
20+
# disables mysql_native_password by default.
21+
mysql_native_password = ON
22+
authentication_policy = 'mysql_native_password'
23+
24+
# Semi-sync replication is required for automated unplanned failover
25+
# (when the primary goes away). Here we just load the plugin so it's
26+
# available if desired, but it's disabled at startup.
27+
#
28+
# VTTablet will enable semi-sync at the proper time when replication is set up,
29+
# or when a primary is promoted or demoted based on the durability policy configured.
30+
plugin-load = rpl_semi_sync_source=semisync_source.so;rpl_semi_sync_replica=semisync_replica.so
31+
32+
# MySQL 8.0.26 and later will not load plugins during --initialize
33+
# which makes these options unknown. Prefixing with --loose
34+
# tells the server it's fine if they are not understood.
35+
loose_rpl_semi_sync_source_timeout = 1000000000000000000
36+
loose_rpl_semi_sync_source_wait_no_replica = 1
37+
38+
# In order to protect against any errand GTIDs we will start the mysql instance
39+
# in super-read-only mode.
40+
super-read-only
41+
42+
# Replication parameters to ensure reparents are fast.
43+
replica_net_timeout = 8

go/vt/mysqlctl/mysqld.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -820,7 +820,11 @@ func (mysqld *Mysqld) getMycnfTemplate() string {
820820
log.Infof("this version of Vitess does not include built-in support for %v %v", mysqld.capabilities.flavor, mysqld.capabilities.version)
821821
}
822822
case 8:
823-
versionConfig = config.MycnfMySQL80
823+
if mysqld.capabilities.version.Minor < 4 {
824+
versionConfig = config.MycnfMySQL80
825+
} else {
826+
versionConfig = config.MycnfMySQL84
827+
}
824828
default:
825829
log.Infof("this version of Vitess does not include built-in support for %v %v", mysqld.capabilities.flavor, mysqld.capabilities.version)
826830
}

0 commit comments

Comments
 (0)