From 4193d0378c02d151a3378ce1e11dc09d89ee39e8 Mon Sep 17 00:00:00 2001 From: Morgan Tocker Date: Tue, 29 Oct 2019 20:31:17 -0600 Subject: [PATCH] Make sure 5.7 doesn't read 5.6 config file Add SBR and sql-mode lines back in Signed-off-by: Morgan Tocker --- config/mycnf/default.cnf | 5 +++++ examples/compose/README.md | 3 +-- examples/compose/external_db/docker-compose.yml | 1 - examples/compose/vttablet-up.sh | 3 +-- .../vttablet-pod-benchmarking-template.yaml | 3 --- examples/kubernetes/vttablet-pod-template.yaml | 6 ------ go/vt/vttest/environment.go | 17 +---------------- helm/vitess/README.md | 2 +- py/vttest/mysql_flavor.py | 4 ---- test/mysql_flavor.py | 8 ++++---- 10 files changed, 13 insertions(+), 39 deletions(-) diff --git a/config/mycnf/default.cnf b/config/mycnf/default.cnf index df2e701741..3a6ee12d08 100644 --- a/config/mycnf/default.cnf +++ b/config/mycnf/default.cnf @@ -31,5 +31,10 @@ connect_timeout = 30 innodb_lock_wait_timeout = 20 max_allowed_packet = 64M +# These two settings are required for the testsuite to pass, +# but enabling them does not spark joy. They should be removed +# in the future. +binlog-format=statement +sql_mode = STRICT_TRANS_TABLES diff --git a/examples/compose/README.md b/examples/compose/README.md index eb801a8fcb..053cf54c85 100644 --- a/examples/compose/README.md +++ b/examples/compose/README.md @@ -152,7 +152,6 @@ DB_CHARSET=CHARACTER SET utf8 COLLATE utf8_general_ci Ensure you have log bin enabled on your external database. You may add the following configs to your conf.d directory and reload mysqld on your server ``` -vitess/config/mycnf/master_mysql56.cnf vitess/config/mycnf/rbr.cnf ``` @@ -258,4 +257,4 @@ vitess/examples/compose$ ./lvtctl.sh ApplyVschema -vschema '{"sharded":false, "t ``` This has since been fixed by -https://github.com/vitessio/vitess/pull/4868 & https://github.com/vitessio/vitess/pull/5010 \ No newline at end of file +https://github.com/vitessio/vitess/pull/4868 & https://github.com/vitessio/vitess/pull/5010 diff --git a/examples/compose/external_db/docker-compose.yml b/examples/compose/external_db/docker-compose.yml index 5b3b28f1f9..b0b1e58f9f 100644 --- a/examples/compose/external_db/docker-compose.yml +++ b/examples/compose/external_db/docker-compose.yml @@ -17,7 +17,6 @@ services: volumes: - vol-db:/var/lib/mysql - ./mysql/:/docker-entrypoint-initdb.d/ - - ./mysql/master_mysql56.cnf:/etc/mysql/conf.d/master_mysql56.cnf - ./mysql/query.log:/var/log/mysql/query.log - ./mysql/slow.log:/var/log/mysql/slow.log healthcheck: diff --git a/examples/compose/vttablet-up.sh b/examples/compose/vttablet-up.sh index 00369ecdd2..3df619ce20 100755 --- a/examples/compose/vttablet-up.sh +++ b/examples/compose/vttablet-up.sh @@ -70,7 +70,6 @@ if [ $tablet_role != "master" ]; then fi # Enforce Row Based Replication export EXTRA_MY_CNF=$VTROOT/config/mycnf/default-fast.cnf:$VTROOT/config/mycnf/rbr.cnf -export EXTRA_MY_CNF=$EXTRA_MY_CNF:$VTROOT/config/mycnf/master_mysql56.cnf mkdir -p $VTDATAROOT/backups @@ -182,4 +181,4 @@ exec $VTROOT/bin/vttablet \ -backup_storage_implementation file \ -file_backup_storage_root $VTDATAROOT/backups \ -queryserver-config-schema-reload-time 60 \ - $external_db_args \ No newline at end of file + $external_db_args diff --git a/examples/kubernetes/vttablet-pod-benchmarking-template.yaml b/examples/kubernetes/vttablet-pod-benchmarking-template.yaml index 8f24da64f5..f1cc59e710 100644 --- a/examples/kubernetes/vttablet-pod-benchmarking-template.yaml +++ b/examples/kubernetes/vttablet-pod-benchmarking-template.yaml @@ -87,9 +87,6 @@ spec: -tablet_uid {{uid}} -socket_file $VTDATAROOT/mysqlctl.sock -init_db_sql_file $VTROOT/config/init_db.sql" vitess - env: - - name: EXTRA_MY_CNF - value: /vt/config/mycnf/benchmark.cnf:/vt/config/mycnf/master_mysql56.cnf volumes: - name: syslog hostPath: {path: /dev/log} diff --git a/examples/kubernetes/vttablet-pod-template.yaml b/examples/kubernetes/vttablet-pod-template.yaml index 52e19aad80..6be80409ca 100644 --- a/examples/kubernetes/vttablet-pod-template.yaml +++ b/examples/kubernetes/vttablet-pod-template.yaml @@ -69,9 +69,6 @@ spec: -orc_api_url http://orchestrator/api -orc_discover_interval 5m -restore_from_backup {{backup_flags}}" vitess - env: - - name: EXTRA_MY_CNF - value: /vt/config/mycnf/master_mysql56.cnf - name: mysql image: {{vitess_image}} volumeMounts: @@ -96,9 +93,6 @@ spec: -tablet_uid {{uid}} -socket_file $VTDATAROOT/mysqlctl.sock -init_db_sql_file $VTROOT/config/init_db.sql" vitess - env: - - name: EXTRA_MY_CNF - value: /vt/config/mycnf/master_mysql56.cnf volumes: - name: syslog hostPath: {path: /dev/log} diff --git a/go/vt/vttest/environment.go b/go/vt/vttest/environment.go index 35b80ce341..551cc4e1d9 100644 --- a/go/vt/vttest/environment.go +++ b/go/vt/vttest/environment.go @@ -116,22 +116,7 @@ func GetMySQLOptions(flavor string) (string, []string, error) { } mycnf := []string{} - 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_mariadb100.cnf") - case "MySQL80": - mycnf = append(mycnf, "config/mycnf/default-fast.cnf") - mycnf = append(mycnf, "config/mycnf/master_mysql80.cnf") - case "MySQL56": - mycnf = append(mycnf, "config/mycnf/default-fast.cnf") - mycnf = append(mycnf, "config/mycnf/master_mysql56.cnf") - default: - return "", nil, fmt.Errorf("unknown mysql flavor: %s", flavor) - } + mycnf = append(mycnf, "config/mycnf/default-fast.cnf") for i, cnf := range mycnf { mycnf[i] = path.Join(os.Getenv("VTTOP"), cnf) diff --git a/helm/vitess/README.md b/helm/vitess/README.md index 8e884b6011..5ff807a552 100644 --- a/helm/vitess/README.md +++ b/helm/vitess/README.md @@ -392,7 +392,7 @@ metadata: data: extra.cnf: |- early-plugin-load=keyring_vault=keyring_vault.so - # this includes default rpl plugins, see https://github.com/vitessio/vitess/blob/master/config/mycnf/master_mysql56.cnf for details + # this includes default rpl plugins, see https://github.com/vitessio/vitess/blob/master/config/mycnf/master_mysql57.cnf for details plugin-load=rpl_semi_sync_master=semisync_master.so;rpl_semi_sync_slave=semisync_slave.so;keyring_udf=keyring_udf.so keyring_vault_config=/vt/usersecrets/vttablet-vault/vault.conf # load keyring configuration from secret innodb_encrypt_tables=ON # encrypt all tables by default diff --git a/py/vttest/mysql_flavor.py b/py/vttest/mysql_flavor.py index 26e8aaf3d4..3da1570e05 100644 --- a/py/vttest/mysql_flavor.py +++ b/py/vttest/mysql_flavor.py @@ -49,7 +49,6 @@ class MariaDB(MysqlFlavor): def my_cnf(self): files = [ os.path.join(vttop, "config/mycnf/default-fast.cnf"), - os.path.join(vttop, "config/mycnf/master_mariadb100.cnf"), ] return ":".join(files) @@ -59,7 +58,6 @@ class MariaDB103(MysqlFlavor): 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) @@ -69,7 +67,6 @@ class MySQL56(MysqlFlavor): def my_cnf(self): files = [ os.path.join(vttop, "config/mycnf/default-fast.cnf"), - os.path.join(vttop, "config/mycnf/master_mysql56.cnf"), ] return ":".join(files) @@ -79,7 +76,6 @@ class MySQL80(MysqlFlavor): def my_cnf(self): files = [ os.path.join(vttop, "config/mycnf/default-fast.cnf"), - os.path.join(vttop, "config/mycnf/master_mysql80.cnf"), ] return ":".join(files) diff --git a/test/mysql_flavor.py b/test/mysql_flavor.py index 9cf057982e..8102ad0cfd 100644 --- a/test/mysql_flavor.py +++ b/test/mysql_flavor.py @@ -126,7 +126,7 @@ class MariaDB(MysqlFlavor): ] def extra_my_cnf(self): - return environment.vttop + "/config/mycnf/master_mariadb100.cnf" + return "" def master_position(self, tablet): gtid = tablet.mquery("", "SELECT @@GLOBAL.gtid_binlog_pos")[0][0] @@ -152,7 +152,7 @@ class MariaDB103(MariaDB): """Overrides specific to MariaDB 10.3+.""" def extra_my_cnf(self): - return environment.vttop + "/config/mycnf/master_mariadb103.cnf" + return "" class MySQL56(MysqlFlavor): """Overrides specific to MySQL 5.6/5.7""" @@ -172,7 +172,7 @@ class MySQL56(MysqlFlavor): ]).strip() == "true" def extra_my_cnf(self): - return environment.vttop + "/config/mycnf/master_mysql56.cnf" + return "" def change_master_commands(self, host, port, pos): gtid = pos.split("/")[1] @@ -186,7 +186,7 @@ class MySQL56(MysqlFlavor): class MySQL80(MySQL56): """Overrides specific to MySQL 8.0.""" def extra_my_cnf(self): - return environment.vttop + "/config/mycnf/master_mysql80.cnf" + return "" def change_passwords(self, password_col): """set real passwords for all users""" return '''