From 9e82bb4f7730590f46e4a60a6a17bf4a409ba97c Mon Sep 17 00:00:00 2001 From: Dirkjan Bussink Date: Thu, 16 Jan 2025 09:53:14 +0100 Subject: [PATCH] Update bundled MySQL version to 8.0.40 We haven't updated the bundled MySQL version in a while and it also blocks us from upgrading our base Debian version for the containers we build as well. So update to the latest 8.0.x version here. It's also at least version 8.0.35, which means that updates after this one are going to be much easier as upgrades / downgrades between different patch versions are possible for 8.0.35 and later. Signed-off-by: Dirkjan Bussink --- changelog/22.0/22.0.0/summary.md | 23 +++++++++++++++++++ docker/utils/install_dependencies.sh | 2 +- docker/vttestserver/Dockerfile.mysql80 | 2 +- go/flags/endtoend/mysqlctl.txt | 2 +- go/flags/endtoend/mysqlctld.txt | 2 +- go/flags/endtoend/vtbackup.txt | 2 +- go/flags/endtoend/vtbench.txt | 2 +- go/flags/endtoend/vtclient.txt | 2 +- go/flags/endtoend/vtcombo.txt | 2 +- go/flags/endtoend/vtctld.txt | 2 +- go/flags/endtoend/vtctldclient.txt | 2 +- go/flags/endtoend/vtexplain.txt | 2 +- go/flags/endtoend/vtgate.txt | 2 +- go/flags/endtoend/vtgateclienttest.txt | 2 +- go/flags/endtoend/vttablet.txt | 2 +- go/flags/endtoend/vttestserver.txt | 2 +- .../collations/integration/collations_test.go | 2 +- go/mysql/config/config.go | 2 +- go/vt/servenv/buildinfo_test.go | 2 +- go/vt/vtgate/semantics/info_schema.go | 2 +- 20 files changed, 42 insertions(+), 19 deletions(-) diff --git a/changelog/22.0/22.0.0/summary.md b/changelog/22.0/22.0.0/summary.md index e63ffcc3547..a7002278275 100644 --- a/changelog/22.0/22.0.0/summary.md +++ b/changelog/22.0/22.0.0/summary.md @@ -12,6 +12,7 @@ - **[Support for More Efficient JSON Replication](#efficient-json-replication)** - **[Support for LAST_INSERT_ID(x)](#last-insert-id)** - **[Support for Maximum Idle Connections in the Pool](#max-idle-connections)** + - **[Update default MySQL version to 8.0.40](#mysql-8-0-40)** - **[Minor Changes](#minor-changes)** - **[VTTablet Flags](#flags-vttablet)** - **[Topology read concurrency behaviour changes](#topo-read-concurrency-changes)** @@ -100,6 +101,28 @@ You can control idle connection retention for the query server’s query pool, s This feature ensures that, during traffic spikes, idle connections are available for faster responses, while minimizing overhead in low-traffic periods by limiting the number of idle connections retained. It helps strike a balance between performance, efficiency, and cost. +### Update default MySQL version to 8.0.40 + +The default major MySQL version used by our `vitess/lite:latest` image is going from `8.0.30` to `8.0.40`. +This change was brought by [Pull Request #TODO](https://github.com/vitessio/vitess/pull/TODO). + +VTGate also advertises MySQL version `8.0.40` by default instead of `8.0.30` if no explicit version is set. The users can set the `mysql_server_version` flag to advertise the correct version. + +#### ⚠️Upgrading to this release with vitess-operator + +If you are using the `vitess-operator` and want to remain on MySQL 5.7, **you are required** to use the `vitess/lite:v16.0.0-mysql57` Docker Image, otherwise the `vitess/lite:v16.0.0` image will be on MySQL 80. + +f you are using the `vitess-operator`, considering that we are bumping the patch version of MySQL 80 from `8.0.30` to `8.0.40`, you will have to manually upgrade: + +1. Add `innodb_fast_shutdown=0` to your extra cnf in your YAML file. +2. Apply this file. +3. Wait for all the pods to be healthy. +4. Then change your YAML file to use the new Docker Images (`vitess/lite:v16.0.0`, defaults to mysql80). +5. Remove `innodb_fast_shutdown=0` from your extra cnf in your YAML file. +6. Apply this file. + +This is the last time this will be needed in the `8.0.x` series, as starting with MySQL `8.0.35` it is possible to upgrade and downgrade between `8.0.x` versions without needing to run `innodb_fast_shutdown=0`. + ## Minor Changes #### VTTablet Flags diff --git a/docker/utils/install_dependencies.sh b/docker/utils/install_dependencies.sh index 91e6e2b8c76..0780d3f9bb8 100755 --- a/docker/utils/install_dependencies.sh +++ b/docker/utils/install_dependencies.sh @@ -92,7 +92,7 @@ mysql57) ;; mysql80) if [ -z "$VERSION" ]; then - VERSION=8.0.30 + VERSION=8.0.40 fi do_fetch https://repo.mysql.com/apt/debian/pool/mysql-8.0/m/mysql-community/mysql-common_${VERSION}-1debian11_amd64.deb /tmp/mysql-common_${VERSION}-1debian11_amd64.deb do_fetch https://repo.mysql.com/apt/debian/pool/mysql-8.0/m/mysql-community/libmysqlclient21_${VERSION}-1debian11_amd64.deb /tmp/libmysqlclient21_${VERSION}-1debian11_amd64.deb diff --git a/docker/vttestserver/Dockerfile.mysql80 b/docker/vttestserver/Dockerfile.mysql80 index 74b9564ef48..1adb365ebb8 100644 --- a/docker/vttestserver/Dockerfile.mysql80 +++ b/docker/vttestserver/Dockerfile.mysql80 @@ -56,4 +56,4 @@ USER vitess COPY docker/vttestserver/setup_vschema_folder.sh /vt/setup_vschema_folder.sh COPY docker/vttestserver/run.sh /vt/run.sh -CMD /vt/run.sh "8.0.30-Vitess" +CMD /vt/run.sh "8.0.40-Vitess" diff --git a/go/flags/endtoend/mysqlctl.txt b/go/flags/endtoend/mysqlctl.txt index 2b179496fff..f803b393a76 100644 --- a/go/flags/endtoend/mysqlctl.txt +++ b/go/flags/endtoend/mysqlctl.txt @@ -71,7 +71,7 @@ Flags: --logtostderr log to standard error instead of files --max-stack-size int configure the maximum stack size in bytes (default 67108864) --mysql_port int MySQL port. (default 3306) - --mysql_server_version string MySQL server version to advertise. (default "8.0.30-Vitess") + --mysql_server_version string MySQL server version to advertise. (default "8.0.40-Vitess") --mysql_socket string Path to the mysqld socket file. --mysqlctl_client_protocol string the protocol to use to talk to the mysqlctl server (default "grpc") --mysqlctl_mycnf_template string template file to use for generating the my.cnf file during server init diff --git a/go/flags/endtoend/mysqlctld.txt b/go/flags/endtoend/mysqlctld.txt index 594329ce073..22c5f37d63f 100644 --- a/go/flags/endtoend/mysqlctld.txt +++ b/go/flags/endtoend/mysqlctld.txt @@ -99,7 +99,7 @@ Flags: --logtostderr log to standard error instead of files --max-stack-size int configure the maximum stack size in bytes (default 67108864) --mysql_port int MySQL port (default 3306) - --mysql_server_version string MySQL server version to advertise. (default "8.0.30-Vitess") + --mysql_server_version string MySQL server version to advertise. (default "8.0.40-Vitess") --mysql_socket string Path to the mysqld socket file --mysqlctl_mycnf_template string template file to use for generating the my.cnf file during server init --mysqlctl_socket string socket file to use for remote mysqlctl actions (empty for local actions) diff --git a/go/flags/endtoend/vtbackup.txt b/go/flags/endtoend/vtbackup.txt index 7bda9048211..7941ce161ff 100644 --- a/go/flags/endtoend/vtbackup.txt +++ b/go/flags/endtoend/vtbackup.txt @@ -184,7 +184,7 @@ Flags: --mysql-shell-speedup-restore speed up restore by disabling redo logging and double write buffer during the restore process --mysql-shutdown-timeout duration how long to wait for mysqld shutdown (default 5m0s) --mysql_port int mysql port (default 3306) - --mysql_server_version string MySQL server version to advertise. (default "8.0.30-Vitess") + --mysql_server_version string MySQL server version to advertise. (default "8.0.40-Vitess") --mysql_socket string path to the mysql socket --mysql_timeout duration how long to wait for mysqld startup (default 5m0s) --opentsdb_uri string URI of opentsdb /api/put method diff --git a/go/flags/endtoend/vtbench.txt b/go/flags/endtoend/vtbench.txt index 260451f6b03..7b0d72af429 100644 --- a/go/flags/endtoend/vtbench.txt +++ b/go/flags/endtoend/vtbench.txt @@ -69,7 +69,7 @@ Flags: --log_err_stacks log stack traces for errors --log_rotate_max_size uint size in bytes at which logs are rotated (glog.MaxSize) (default 1887436800) --logtostderr log to standard error instead of files - --mysql_server_version string MySQL server version to advertise. (default "8.0.30-Vitess") + --mysql_server_version string MySQL server version to advertise. (default "8.0.40-Vitess") --port int VTGate port --pprof strings enable profiling --pprof-http enable pprof http endpoints diff --git a/go/flags/endtoend/vtclient.txt b/go/flags/endtoend/vtclient.txt index 57ddf892ac8..6c0a87d6551 100644 --- a/go/flags/endtoend/vtclient.txt +++ b/go/flags/endtoend/vtclient.txt @@ -35,7 +35,7 @@ Flags: --logtostderr log to standard error instead of files --max_sequence_id int max sequence ID. --min_sequence_id int min sequence ID to generate. When max_sequence_id > min_sequence_id, for each query, a number is generated in [min_sequence_id, max_sequence_id) and attached to the end of the bind variables. - --mysql_server_version string MySQL server version to advertise. (default "8.0.30-Vitess") + --mysql_server_version string MySQL server version to advertise. (default "8.0.40-Vitess") --parallel int DMLs only: Number of threads executing the same query in parallel. Useful for simple load testing. (default 1) --pprof strings enable profiling --pprof-http enable pprof http endpoints diff --git a/go/flags/endtoend/vtcombo.txt b/go/flags/endtoend/vtcombo.txt index 052c19ecaae..39f92dd4c9a 100644 --- a/go/flags/endtoend/vtcombo.txt +++ b/go/flags/endtoend/vtcombo.txt @@ -242,7 +242,7 @@ Flags: --mysql_server_ssl_key string Path to ssl key for mysql server plugin SSL --mysql_server_ssl_server_ca string path to server CA in PEM format, which will be combine with server cert, return full certificate chain to clients --mysql_server_tls_min_version string Configures the minimal TLS version negotiated when SSL is enabled. Defaults to TLSv1.2. Options: TLSv1.0, TLSv1.1, TLSv1.2, TLSv1.3. - --mysql_server_version string MySQL server version to advertise. (default "8.0.30-Vitess") + --mysql_server_version string MySQL server version to advertise. (default "8.0.40-Vitess") --mysql_server_write_timeout duration connection write timeout --mysql_slow_connect_warn_threshold duration Warn if it takes more than the given threshold for a mysql connection to establish --mysql_tcp_version string Select tcp, tcp4, or tcp6 to control the socket type. (default "tcp") diff --git a/go/flags/endtoend/vtctld.txt b/go/flags/endtoend/vtctld.txt index c84c5fadf5f..764c07a9d69 100644 --- a/go/flags/endtoend/vtctld.txt +++ b/go/flags/endtoend/vtctld.txt @@ -98,7 +98,7 @@ Flags: --log_rotate_max_size uint size in bytes at which logs are rotated (glog.MaxSize) (default 1887436800) --logtostderr log to standard error instead of files --max-stack-size int configure the maximum stack size in bytes (default 67108864) - --mysql_server_version string MySQL server version to advertise. (default "8.0.30-Vitess") + --mysql_server_version string MySQL server version to advertise. (default "8.0.40-Vitess") --onclose_timeout duration wait no more than this for OnClose handlers before stopping (default 10s) --onterm_timeout duration wait no more than this for OnTermSync handlers before stopping (default 10s) --opentsdb_uri string URI of opentsdb /api/put method diff --git a/go/flags/endtoend/vtctldclient.txt b/go/flags/endtoend/vtctldclient.txt index 5ff2a7b21da..bfa50a4d98c 100644 --- a/go/flags/endtoend/vtctldclient.txt +++ b/go/flags/endtoend/vtctldclient.txt @@ -134,7 +134,7 @@ Flags: --log_rotate_max_size uint size in bytes at which logs are rotated (glog.MaxSize) (default 1887436800) --logbuflevel int Buffer log messages logged at this level or lower (-1 means don't buffer; 0 means buffer INFO only; ...). Has limited applicability on non-prod platforms. --logtostderr log to standard error instead of files - --mysql_server_version string MySQL server version to advertise. (default "8.0.30-Vitess") + --mysql_server_version string MySQL server version to advertise. (default "8.0.40-Vitess") --purge_logs_interval duration how often try to remove old logs (default 1h0m0s) --security_policy string the name of a registered security policy to use for controlling access to URLs - empty means allow all for anyone (built-in policies: deny-all, read-only) --server string server to use for the connection (required) diff --git a/go/flags/endtoend/vtexplain.txt b/go/flags/endtoend/vtexplain.txt index fdd289e63c7..90013fe1b98 100644 --- a/go/flags/endtoend/vtexplain.txt +++ b/go/flags/endtoend/vtexplain.txt @@ -59,7 +59,7 @@ Flags: --log_err_stacks log stack traces for errors --log_rotate_max_size uint size in bytes at which logs are rotated (glog.MaxSize) (default 1887436800) --logtostderr log to standard error instead of files - --mysql_server_version string MySQL server version to advertise. (default "8.0.30-Vitess") + --mysql_server_version string MySQL server version to advertise. (default "8.0.40-Vitess") --normalize Whether to enable vtgate normalization --output-mode string Output in human-friendly text or json (default "text") --planner-version string Sets the default planner to use. Valid values are: Gen4, Gen4Greedy, Gen4Left2Right diff --git a/go/flags/endtoend/vtgate.txt b/go/flags/endtoend/vtgate.txt index fde17f89c49..bfecdd07288 100644 --- a/go/flags/endtoend/vtgate.txt +++ b/go/flags/endtoend/vtgate.txt @@ -157,7 +157,7 @@ Flags: --mysql_server_ssl_key string Path to ssl key for mysql server plugin SSL --mysql_server_ssl_server_ca string path to server CA in PEM format, which will be combine with server cert, return full certificate chain to clients --mysql_server_tls_min_version string Configures the minimal TLS version negotiated when SSL is enabled. Defaults to TLSv1.2. Options: TLSv1.0, TLSv1.1, TLSv1.2, TLSv1.3. - --mysql_server_version string MySQL server version to advertise. (default "8.0.30-Vitess") + --mysql_server_version string MySQL server version to advertise. (default "8.0.40-Vitess") --mysql_server_write_timeout duration connection write timeout --mysql_slow_connect_warn_threshold duration Warn if it takes more than the given threshold for a mysql connection to establish --mysql_tcp_version string Select tcp, tcp4, or tcp6 to control the socket type. (default "tcp") diff --git a/go/flags/endtoend/vtgateclienttest.txt b/go/flags/endtoend/vtgateclienttest.txt index 8a2f18b6b5a..d5b45e57b1e 100644 --- a/go/flags/endtoend/vtgateclienttest.txt +++ b/go/flags/endtoend/vtgateclienttest.txt @@ -53,7 +53,7 @@ Flags: --log_rotate_max_size uint size in bytes at which logs are rotated (glog.MaxSize) (default 1887436800) --logtostderr log to standard error instead of files --max-stack-size int configure the maximum stack size in bytes (default 67108864) - --mysql_server_version string MySQL server version to advertise. (default "8.0.30-Vitess") + --mysql_server_version string MySQL server version to advertise. (default "8.0.40-Vitess") --onclose_timeout duration wait no more than this for OnClose handlers before stopping (default 10s) --onterm_timeout duration wait no more than this for OnTermSync handlers before stopping (default 10s) --pid_file string If set, the process will write its pid to the named file, and delete it on graceful shutdown. diff --git a/go/flags/endtoend/vttablet.txt b/go/flags/endtoend/vttablet.txt index e2b0c30db7f..865c87d56fd 100644 --- a/go/flags/endtoend/vttablet.txt +++ b/go/flags/endtoend/vttablet.txt @@ -244,7 +244,7 @@ Flags: --mysql-shell-should-drain decide if we should drain while taking a backup or continue to serving traffic --mysql-shell-speedup-restore speed up restore by disabling redo logging and double write buffer during the restore process --mysql-shutdown-timeout duration timeout to use when MySQL is being shut down. (default 5m0s) - --mysql_server_version string MySQL server version to advertise. (default "8.0.30-Vitess") + --mysql_server_version string MySQL server version to advertise. (default "8.0.40-Vitess") --mysqlctl_mycnf_template string template file to use for generating the my.cnf file during server init --mysqlctl_socket string socket file to use for remote mysqlctl actions (empty for local actions) --onclose_timeout duration wait no more than this for OnClose handlers before stopping (default 10s) diff --git a/go/flags/endtoend/vttestserver.txt b/go/flags/endtoend/vttestserver.txt index 042ffd37643..385b7194652 100644 --- a/go/flags/endtoend/vttestserver.txt +++ b/go/flags/endtoend/vttestserver.txt @@ -96,7 +96,7 @@ Flags: --mysql-shell-speedup-restore speed up restore by disabling redo logging and double write buffer during the restore process --mysql_bind_host string which host to bind vtgate mysql listener to (default "localhost") --mysql_only If this flag is set only mysql is initialized. The rest of the vitess components are not started. Also, the output specifies the mysql unix socket instead of the vtgate port. - --mysql_server_version string MySQL server version to advertise. (default "8.0.30-Vitess") + --mysql_server_version string MySQL server version to advertise. (default "8.0.40-Vitess") --mysqlctl_mycnf_template string template file to use for generating the my.cnf file during server init --mysqlctl_socket string socket file to use for remote mysqlctl actions (empty for local actions) --no_scatter when set to true, the planner will fail instead of producing a plan that includes scatter queries diff --git a/go/mysql/collations/integration/collations_test.go b/go/mysql/collations/integration/collations_test.go index 519f4560faf..c599eceaa2e 100644 --- a/go/mysql/collations/integration/collations_test.go +++ b/go/mysql/collations/integration/collations_test.go @@ -45,7 +45,7 @@ var collationEnv *collations.Environment func init() { // We require MySQL 8.0 collations for the comparisons in the tests - collationEnv = collations.NewEnvironment("8.0.30") + collationEnv = collations.NewEnvironment("8.0.40") } func getSQLQueries(t *testing.T, testfile string) []string { diff --git a/go/mysql/config/config.go b/go/mysql/config/config.go index 6070d0d6248..4f9a8b3a734 100644 --- a/go/mysql/config/config.go +++ b/go/mysql/config/config.go @@ -1,5 +1,5 @@ package config const DefaultSQLMode = "ONLY_FULL_GROUP_BY,STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_ENGINE_SUBSTITUTION" -const DefaultMySQLVersion = "8.0.30" +const DefaultMySQLVersion = "8.0.40" const LegacyMySQLVersion = "5.7.31" diff --git a/go/vt/servenv/buildinfo_test.go b/go/vt/servenv/buildinfo_test.go index bc972df03ea..a4a63cdb560 100644 --- a/go/vt/servenv/buildinfo_test.go +++ b/go/vt/servenv/buildinfo_test.go @@ -45,7 +45,7 @@ func TestVersionString(t *testing.T) { assert.Equal(t, "Version: v1.2.3-SNAPSHOT (Jenkins build 422) (Git revision d54b87ca0be09b678bb4490060e8f23f890ddb92 branch 'gitBranch') built on time is now by user@host using 1.20.2 amiga/amd64", v.String()) - assert.Equal(t, "8.0.30-Vitess", v.MySQLVersion()) + assert.Equal(t, "8.0.40-Vitess", v.MySQLVersion()) } func TestBuildVersionStats(t *testing.T) { diff --git a/go/vt/vtgate/semantics/info_schema.go b/go/vt/vtgate/semantics/info_schema.go index 127f4a00960..b33a20620e4 100644 --- a/go/vt/vtgate/semantics/info_schema.go +++ b/go/vt/vtgate/semantics/info_schema.go @@ -699,7 +699,7 @@ func getInfoSchema57() map[string][]vindexes.Column { // getInfoSchema80 returns a map of all information_schema tables and their columns with types // To recreate this information from MySQL, you can run the test in info_schema_gen_test.go func getInfoSchema80() map[string][]vindexes.Column { - parser, err := sqlparser.New(sqlparser.Options{MySQLServerVersion: "8.0.30"}) + parser, err := sqlparser.New(sqlparser.Options{MySQLServerVersion: "8.0.40"}) if err != nil { panic(err) }