From cb624f56536d72fd6f5aa652a2cfdc8aa28c2b34 Mon Sep 17 00:00:00 2001 From: Dirkjan Bussink Date: Thu, 2 May 2024 16:29:17 +0200 Subject: [PATCH] endtoend: Remove usage of deprecated terminology (#15827) Signed-off-by: Dirkjan Bussink --- .github/workflows/docker_build_old_base.yml | 4 +- .../workflows/docker_build_vttestserver.yml | 4 +- doc/DockerBuild.md | 13 +--- docker/local/Dockerfile | 2 +- docker/test/run.sh | 10 +-- docker/vttestserver/Dockerfile.mysql57 | 61 ------------------- .../reparent/emergencyreparent/ers_test.go | 6 +- .../reparent/plannedreparent/reparent_test.go | 14 ++--- go/test/endtoend/reparent/utils/utils.go | 4 +- .../buffer/reparent/failover_buffer_test.go | 8 +-- go/test/endtoend/tabletgateway/vtgate_test.go | 8 +-- .../tabletmanager/tablet_health_test.go | 2 +- go/test/endtoend/tabletmanager/tablet_test.go | 6 +- .../testdata/config/init_testserver_db.sql | 2 +- go/test/endtoend/vtorc/general/vtorc_test.go | 20 +++--- .../vtorc/readtopologyinstance/main_test.go | 4 +- go/test/endtoend/vtorc/utils/utils.go | 8 +-- test.go | 2 +- 18 files changed, 54 insertions(+), 124 deletions(-) delete mode 100644 docker/vttestserver/Dockerfile.mysql57 diff --git a/.github/workflows/docker_build_old_base.yml b/.github/workflows/docker_build_old_base.yml index 4dcadaa59ff..e7e280963b1 100644 --- a/.github/workflows/docker_build_old_base.yml +++ b/.github/workflows/docker_build_old_base.yml @@ -19,7 +19,7 @@ jobs: strategy: fail-fast: true matrix: - branch: [ latest, mysql57, percona57, percona80 ] + branch: [ latest, percona80 ] steps: - name: Check out code @@ -256,4 +256,4 @@ jobs: tags: ${{ env.DOCKER_TAG_DEFAULT_DEBIAN }} build-args: | VT_BASE_VER=${{ env.TAG_NAME }} - DEBIAN_VER=${{ matrix.debian }}-slim \ No newline at end of file + DEBIAN_VER=${{ matrix.debian }}-slim diff --git a/.github/workflows/docker_build_vttestserver.yml b/.github/workflows/docker_build_vttestserver.yml index 927e55be3e0..1d157eef921 100644 --- a/.github/workflows/docker_build_vttestserver.yml +++ b/.github/workflows/docker_build_vttestserver.yml @@ -21,7 +21,7 @@ jobs: strategy: fail-fast: true matrix: - branch: [ mysql57, mysql80 ] + branch: [ mysql80 ] steps: - name: Check out code @@ -62,4 +62,4 @@ jobs: context: . file: ${{ env.DOCKERFILE }} push: true - tags: ${{ env.DOCKER_TAG }} \ No newline at end of file + tags: ${{ env.DOCKER_TAG }} diff --git a/doc/DockerBuild.md b/doc/DockerBuild.md index 7ffecafce34..2f24d62a92c 100644 --- a/doc/DockerBuild.md +++ b/doc/DockerBuild.md @@ -24,13 +24,10 @@ Then you can run our build script for the `lite` image which extracts the Vitess or [vendor.json](https://github.com/vitessio/vitess/blob/main/vendor/vendor.json), for example to add new dependencies. If you do need it then build the bootstrap image, otherwise pull the image using one of the following - commands depending on the MySQL flavor you want: + command. ```sh - vitess$ docker pull vitess/bootstrap:mysql57 # MySQL Community Edition 5.7 - vitess$ docker pull vitess/bootstrap:mysql56 # MySQL Community Edition 5.6 - vitess$ docker pull vitess/bootstrap:percona57 # Percona Server 5.7 - vitess$ docker pull vitess/bootstrap:percona # Percona Server + vitess$ docker pull vitess/bootstrap:latest ``` **Note:** If you have already downloaded the `vitess/bootstrap:` @@ -41,14 +38,8 @@ Then you can run our build script for the `lite` image which extracts the Vitess This will run a script that extracts from `vitess/bootstrap` only the files needed to run Vitess. - Choose one of the following commands (the command without suffix builds - the default image containing MySQL 5.7): - ```sh vitess$ make docker_lite - vitess$ make docker_lite_mysql56 - vitess$ make docker_lite_percona57 - vitess$ make docker_lite_percona ``` 1. Re-tag the image under your personal repository, then upload it. diff --git a/docker/local/Dockerfile b/docker/local/Dockerfile index 9a5faf99a75..e6772e9ff01 100644 --- a/docker/local/Dockerfile +++ b/docker/local/Dockerfile @@ -8,7 +8,7 @@ RUN apt-get install -y sudo curl vim jq # Install dependencies COPY docker/utils/install_dependencies.sh /vt/dist/install_dependencies.sh -RUN /vt/dist/install_dependencies.sh mysql57 +RUN /vt/dist/install_dependencies.sh mysql80 COPY docker/local/install_local_dependencies.sh /vt/dist/install_local_dependencies.sh RUN /vt/dist/install_local_dependencies.sh diff --git a/docker/test/run.sh b/docker/test/run.sh index e41a529c51d..dd2a0cbc7d5 100755 --- a/docker/test/run.sh +++ b/docker/test/run.sh @@ -30,16 +30,16 @@ # # Examples: # a) Start an interactive shell within the Docker image. -# $ docker/test/run.sh mysql57 bash +# $ docker/test/run.sh mysql80 bash # # b) Build the code and run a test. -# $ docker/test/run.sh mysql57 "make build && ./test/keyrange_test.py -v" +# $ docker/test/run.sh mysql80 "make build && ./test/keyrange_test.py -v" # -# c) Cache the output of the command e.g. cache "make build" as we do for Travis CI. -# $ docker/test/run.sh --create_docker_cache vitess/bootstrap:rm_mysql57_test_cache_do_NOT_push mysql57 "make build" +# c) Cache the output of the command e.g. cache "make build" as we do for CI. +# $ docker/test/run.sh --create_docker_cache vitess/bootstrap:rm_mysql80_test_cache_do_NOT_push mysql80 "make build" # # d) Run the test using a cache image. -# $ docker/test/run.sh --use_docker_cache vitess/bootstrap:rm_mysql57_test_cache_do_NOT_push mysql57 "./test/keyrange_test.py -v" +# $ docker/test/run.sh --use_docker_cache vitess/bootstrap:rm_mysql80_test_cache_do_NOT_push mysql80 "./test/keyrange_test.py -v" # Functions. diff --git a/docker/vttestserver/Dockerfile.mysql57 b/docker/vttestserver/Dockerfile.mysql57 deleted file mode 100644 index 27a9c8212af..00000000000 --- a/docker/vttestserver/Dockerfile.mysql57 +++ /dev/null @@ -1,61 +0,0 @@ -# Copyright 2021 The Vitess Authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# NOTE: We have to build the Vitess binaries from scratch instead of sharing -# a base image because Docker Hub dropped the feature we relied upon to -# ensure images contain the right binaries. - -# Use a temporary layer for the build stage. -ARG bootstrap_version=31 -ARG image="vitess/bootstrap:${bootstrap_version}-mysql57" - -FROM "${image}" AS builder - -# Allows docker builds to set the BUILD_NUMBER -ARG BUILD_NUMBER - -# Re-copy sources from working tree. -COPY --chown=vitess:vitess . /vt/src/vitess.io/vitess - -# Build and install Vitess in a temporary output directory. -USER vitess -RUN make install-testing PREFIX=/vt/install - -# Start over and build the final image. -FROM debian:bullseye-slim - -# Install dependencies -COPY docker/utils/install_dependencies.sh /vt/dist/install_dependencies.sh -RUN /vt/dist/install_dependencies.sh mysql57 - -# Set up Vitess user and directory tree. -RUN groupadd -r vitess && useradd -r -g vitess vitess -RUN mkdir -p /vt/vtdataroot && chown -R vitess:vitess /vt - -# Set up Vitess environment (just enough to run pre-built Go binaries) -ENV VTROOT /vt -ENV VTDATAROOT /vt/vtdataroot -ENV PATH $VTROOT/bin:$PATH - -# Copy artifacts from builder layer. -COPY --from=builder --chown=vitess:vitess /vt/install /vt - -# Create mount point for actual data (e.g. MySQL data dir) -VOLUME /vt/vtdataroot -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 "5.7.31-vitess" diff --git a/go/test/endtoend/reparent/emergencyreparent/ers_test.go b/go/test/endtoend/reparent/emergencyreparent/ers_test.go index 95942b5f16b..0eaac97a4f2 100644 --- a/go/test/endtoend/reparent/emergencyreparent/ers_test.go +++ b/go/test/endtoend/reparent/emergencyreparent/ers_test.go @@ -357,12 +357,12 @@ func TestNoReplicationStatusAndIOThreadStopped(t *testing.T) { tablets := clusterInstance.Keyspaces[0].Shards[0].Vttablets utils.ConfirmReplication(t, tablets[0], []*cluster.Vttablet{tablets[1], tablets[2], tablets[3]}) - err := clusterInstance.VtctldClientProcess.ExecuteCommand("ExecuteFetchAsDBA", tablets[1].Alias, `STOP SLAVE`) + err := clusterInstance.VtctldClientProcess.ExecuteCommand("ExecuteFetchAsDBA", tablets[1].Alias, `STOP REPLICA`) require.NoError(t, err) - err = clusterInstance.VtctldClientProcess.ExecuteCommand("ExecuteFetchAsDBA", tablets[1].Alias, `RESET SLAVE ALL`) + err = clusterInstance.VtctldClientProcess.ExecuteCommand("ExecuteFetchAsDBA", tablets[1].Alias, `RESET REPLICA ALL`) require.NoError(t, err) // - err = clusterInstance.VtctldClientProcess.ExecuteCommand("ExecuteFetchAsDBA", tablets[3].Alias, `STOP SLAVE IO_THREAD;`) + err = clusterInstance.VtctldClientProcess.ExecuteCommand("ExecuteFetchAsDBA", tablets[3].Alias, `STOP REPLICA IO_THREAD;`) require.NoError(t, err) // Run an additional command in the current primary which will only be acked by tablets[2] and be in its relay log. insertedVal := utils.ConfirmReplication(t, tablets[0], nil) diff --git a/go/test/endtoend/reparent/plannedreparent/reparent_test.go b/go/test/endtoend/reparent/plannedreparent/reparent_test.go index de10e9921c1..d9d6cb06b79 100644 --- a/go/test/endtoend/reparent/plannedreparent/reparent_test.go +++ b/go/test/endtoend/reparent/plannedreparent/reparent_test.go @@ -96,7 +96,7 @@ func TestPRSWithDrainedLaggingTablet(t *testing.T) { utils.ConfirmReplication(t, tablets[0], []*cluster.Vttablet{tablets[1], tablets[2], tablets[3]}) // make tablets[1 lag from the other tablets by setting the delay to a large number - utils.RunSQLs(context.Background(), t, []string{`stop slave`, `CHANGE MASTER TO MASTER_DELAY = 1999`, `start slave;`}, tablets[1]) + utils.RunSQLs(context.Background(), t, []string{`stop replica`, `CHANGE REPLICATION SOURCE TO SOURCE_DELAY = 1999`, `start replica;`}, tablets[1]) // insert another row in tablets[1 utils.ConfirmReplication(t, tablets[0], []*cluster.Vttablet{tablets[2], tablets[3]}) @@ -224,7 +224,7 @@ func reparentFromOutside(t *testing.T, clusterInstance *cluster.LocalProcessClus } // commands to convert a replica to be writable - promoteReplicaCommands := []string{"STOP SLAVE", "RESET SLAVE ALL", "SET GLOBAL read_only = OFF"} + promoteReplicaCommands := []string{"STOP REPLICA", "RESET REPLICA ALL", "SET GLOBAL read_only = OFF"} utils.RunSQLs(ctx, t, promoteReplicaCommands, tablets[1]) // Get primary position @@ -233,9 +233,9 @@ func reparentFromOutside(t *testing.T, clusterInstance *cluster.LocalProcessClus // tablets[0] will now be a replica of tablets[1 changeReplicationSourceCommands := []string{ "RESET MASTER", - "RESET SLAVE", + "RESET REPLICA", fmt.Sprintf("SET GLOBAL gtid_purged = '%s'", gtID), - fmt.Sprintf("CHANGE MASTER TO MASTER_HOST='%s', MASTER_PORT=%d, MASTER_USER='vt_repl', MASTER_AUTO_POSITION = 1", utils.Hostname, tablets[1].MySQLPort), + fmt.Sprintf("CHANGE REPLICATION SOURCE TO SOURCE_HOST='%s', SOURCE_PORT=%d, SOURCE_USER='vt_repl', SOURCE_AUTO_POSITION = 1", utils.Hostname, tablets[1].MySQLPort), } utils.RunSQLs(ctx, t, changeReplicationSourceCommands, tablets[0]) @@ -244,11 +244,11 @@ func reparentFromOutside(t *testing.T, clusterInstance *cluster.LocalProcessClus // tablets[2 will be a replica of tablets[1 changeReplicationSourceCommands = []string{ - "STOP SLAVE", + "STOP REPLICA", "RESET MASTER", fmt.Sprintf("SET GLOBAL gtid_purged = '%s'", gtID), - fmt.Sprintf("CHANGE MASTER TO MASTER_HOST='%s', MASTER_PORT=%d, MASTER_USER='vt_repl', MASTER_AUTO_POSITION = 1", utils.Hostname, tablets[1].MySQLPort), - "START SLAVE", + fmt.Sprintf("CHANGE REPLICATION SOURCE TO SOURCE_HOST='%s', SOURCE_PORT=%d, SOURCE_USER='vt_repl', SOURCE_AUTO_POSITION = 1", utils.Hostname, tablets[1].MySQLPort), + "START REPLICA", } utils.RunSQLs(ctx, t, changeReplicationSourceCommands, tablets[2]) diff --git a/go/test/endtoend/reparent/utils/utils.go b/go/test/endtoend/reparent/utils/utils.go index 39f29c789d7..5038352d721 100644 --- a/go/test/endtoend/reparent/utils/utils.go +++ b/go/test/endtoend/reparent/utils/utils.go @@ -610,7 +610,7 @@ func WaitForReplicationToStart(t *testing.T, clusterInstance *cluster.LocalProce // CheckReplicaStatus checks the replication status and asserts that the replication is stopped func CheckReplicaStatus(ctx context.Context, t *testing.T, tablet *cluster.Vttablet) { - qr := RunSQL(ctx, t, "show slave status", tablet) + qr := RunSQL(ctx, t, "show replica status", tablet) IOThreadRunning := fmt.Sprintf("%v", qr.Rows[0][10]) SQLThreadRunning := fmt.Sprintf("%v", qr.Rows[0][10]) assert.Equal(t, IOThreadRunning, "VARCHAR(\"No\")") @@ -765,7 +765,7 @@ func SetReplicationSourceFailed(tablet *cluster.Vttablet, prsOut string) bool { // CheckReplicationStatus checks that the replication for sql and io threads is setup as expected func CheckReplicationStatus(ctx context.Context, t *testing.T, tablet *cluster.Vttablet, sqlThreadRunning bool, ioThreadRunning bool) { - res := RunSQL(ctx, t, "show slave status", tablet) + res := RunSQL(ctx, t, "show replica status", tablet) if ioThreadRunning { require.Equal(t, "Yes", res.Rows[0][10].ToString()) } else { diff --git a/go/test/endtoend/tabletgateway/buffer/reparent/failover_buffer_test.go b/go/test/endtoend/tabletgateway/buffer/reparent/failover_buffer_test.go index 486dc3ef9e5..7bb139438f8 100644 --- a/go/test/endtoend/tabletgateway/buffer/reparent/failover_buffer_test.go +++ b/go/test/endtoend/tabletgateway/buffer/reparent/failover_buffer_test.go @@ -31,7 +31,7 @@ import ( var ( demoteQueries = []string{"SET GLOBAL read_only = ON", "FLUSH TABLES WITH READ LOCK", "UNLOCK TABLES"} - promoteQueries = []string{"STOP SLAVE", "RESET SLAVE ALL", "SET GLOBAL read_only = OFF"} + promoteQueries = []string{"STOP REPLICA", "RESET REPLICA ALL", "SET GLOBAL read_only = OFF"} hostname = "localhost" ) @@ -73,11 +73,11 @@ func failoverExternalReparenting(t *testing.T, clusterInstance *cluster.LocalPro // Use 'localhost' as hostname because Travis CI worker hostnames // are too long for MySQL replication. changeSourceCommands := []string{ - "STOP SLAVE", + "STOP REPLICA", "RESET MASTER", fmt.Sprintf("SET GLOBAL gtid_purged = '%s'", gtID), - fmt.Sprintf("CHANGE MASTER TO MASTER_HOST='%s', MASTER_PORT=%d, MASTER_USER='vt_repl', MASTER_AUTO_POSITION = 1", "localhost", newPrimary.MySQLPort), - "START SLAVE", + fmt.Sprintf("CHANGE REPLICATION SOURCE TO SOURCE_HOST='%s', SOURCE_PORT=%d, SOURCE_USER='vt_repl', SOURCE_AUTO_POSITION = 1", "localhost", newPrimary.MySQLPort), + "START REPLICA", } err = oldPrimary.VttabletProcess.QueryTabletMultiple(changeSourceCommands, keyspaceUnshardedName, true) require.NoError(t, err) diff --git a/go/test/endtoend/tabletgateway/vtgate_test.go b/go/test/endtoend/tabletgateway/vtgate_test.go index a48a22f2cb0..1f4f8758e16 100644 --- a/go/test/endtoend/tabletgateway/vtgate_test.go +++ b/go/test/endtoend/tabletgateway/vtgate_test.go @@ -80,16 +80,16 @@ func TestVtgateReplicationStatusCheck(t *testing.T) { } }() // Stop replication on the non-PRIMARY tablets. - _, err = clusterInstance.VtctldClientProcess.ExecuteCommandWithOutput("ExecuteFetchAsDBA", clusterInstance.Keyspaces[0].Shards[0].Replica().Alias, "stop slave") + _, err = clusterInstance.VtctldClientProcess.ExecuteCommandWithOutput("ExecuteFetchAsDBA", clusterInstance.Keyspaces[0].Shards[0].Replica().Alias, "stop replica") require.NoError(t, err) - _, err = clusterInstance.VtctldClientProcess.ExecuteCommandWithOutput("ExecuteMultiFetchAsDBA", clusterInstance.Keyspaces[0].Shards[0].Rdonly().Alias, "stop slave") + _, err = clusterInstance.VtctldClientProcess.ExecuteCommandWithOutput("ExecuteMultiFetchAsDBA", clusterInstance.Keyspaces[0].Shards[0].Rdonly().Alias, "stop replica") require.NoError(t, err) // Restart replication afterward as the cluster is re-used. defer func() { - _, err = clusterInstance.VtctldClientProcess.ExecuteCommandWithOutput("ExecuteFetchAsDBA", clusterInstance.Keyspaces[0].Shards[0].Replica().Alias, "start slave") + _, err = clusterInstance.VtctldClientProcess.ExecuteCommandWithOutput("ExecuteFetchAsDBA", clusterInstance.Keyspaces[0].Shards[0].Replica().Alias, "start replica") require.NoError(t, err) // Testing ExecuteMultiFetchAsDBA by running multiple commands in a single call: - _, err = clusterInstance.VtctldClientProcess.ExecuteCommandWithOutput("ExecuteMultiFetchAsDBA", clusterInstance.Keyspaces[0].Shards[0].Rdonly().Alias, "start slave sql_thread; start slave io_thread;") + _, err = clusterInstance.VtctldClientProcess.ExecuteCommandWithOutput("ExecuteMultiFetchAsDBA", clusterInstance.Keyspaces[0].Shards[0].Rdonly().Alias, "start replica sql_thread; start replica io_thread;") require.NoError(t, err) }() time.Sleep(2 * time.Second) // Build up some replication lag diff --git a/go/test/endtoend/tabletmanager/tablet_health_test.go b/go/test/endtoend/tabletmanager/tablet_health_test.go index c8eb43b682f..bf3747fde29 100644 --- a/go/test/endtoend/tabletmanager/tablet_health_test.go +++ b/go/test/endtoend/tabletmanager/tablet_health_test.go @@ -119,7 +119,7 @@ func TestHealthCheck(t *testing.T) { // Make sure the primary is still primary checkTabletType(t, primaryTablet.Alias, "PRIMARY") - utils.Exec(t, conn, "stop slave") + utils.Exec(t, conn, "stop replica") // stop replication, make sure we don't go unhealthy. err = clusterInstance.VtctldClientProcess.ExecuteCommand("StopReplication", rTablet.Alias) diff --git a/go/test/endtoend/tabletmanager/tablet_test.go b/go/test/endtoend/tabletmanager/tablet_test.go index 830502268d1..398610d82de 100644 --- a/go/test/endtoend/tabletmanager/tablet_test.go +++ b/go/test/endtoend/tabletmanager/tablet_test.go @@ -82,11 +82,11 @@ func TestResetReplicationParameters(t *testing.T) { require.NoError(t, err) // Set a replication source on the tablet and start replication - err = tablet.VttabletProcess.QueryTabletMultiple([]string{"stop slave", "change master to master_host = 'localhost', master_port = 123", "start slave"}, keyspaceName, false) + err = tablet.VttabletProcess.QueryTabletMultiple([]string{"stop replica", "change replication source to source_host = 'localhost', source_port = 123", "start replica"}, keyspaceName, false) require.NoError(t, err) // Check the replica status. - res, err := tablet.VttabletProcess.QueryTablet("show slave status", keyspaceName, false) + res, err := tablet.VttabletProcess.QueryTablet("show replica status", keyspaceName, false) require.NoError(t, err) // This is expected to return 1 row result require.Len(t, res.Rows, 1) @@ -96,7 +96,7 @@ func TestResetReplicationParameters(t *testing.T) { require.NoError(t, err) // Recheck the replica status and this time is should be empty - res, err = tablet.VttabletProcess.QueryTablet("show slave status", keyspaceName, false) + res, err = tablet.VttabletProcess.QueryTablet("show replica status", keyspaceName, false) require.NoError(t, err) require.Len(t, res.Rows, 0) } diff --git a/go/test/endtoend/vreplication/testdata/config/init_testserver_db.sql b/go/test/endtoend/vreplication/testdata/config/init_testserver_db.sql index 2be570ca152..89998b856b5 100644 --- a/go/test/endtoend/vreplication/testdata/config/init_testserver_db.sql +++ b/go/test/endtoend/vreplication/testdata/config/init_testserver_db.sql @@ -79,7 +79,7 @@ GRANT SELECT, PROCESS, SUPER, REPLICATION CLIENT, RELOAD GRANT SELECT, UPDATE, DELETE, DROP ON performance_schema.* TO 'vt_monitoring'@'localhost'; -RESET SLAVE ALL; +RESET REPLICA ALL; RESET MASTER; # custom sql is used to add custom scripts like creating users/passwords. We use it in our tests diff --git a/go/test/endtoend/vtorc/general/vtorc_test.go b/go/test/endtoend/vtorc/general/vtorc_test.go index 1adc091be59..8ff66fad59c 100644 --- a/go/test/endtoend/vtorc/general/vtorc_test.go +++ b/go/test/endtoend/vtorc/general/vtorc_test.go @@ -172,7 +172,7 @@ func TestVTOrcRepairs(t *testing.T) { utils.WaitForSuccessfulRecoveryCount(t, vtOrcProcess, logic.FixReplicaRecoveryName, 2) // Stop just the IO thread on the replica - _, err = utils.RunSQL(t, "STOP SLAVE IO_THREAD", replica, "") + _, err = utils.RunSQL(t, "STOP REPLICA IO_THREAD", replica, "") require.NoError(t, err) // check replication is setup correctly @@ -180,7 +180,7 @@ func TestVTOrcRepairs(t *testing.T) { utils.WaitForSuccessfulRecoveryCount(t, vtOrcProcess, logic.FixReplicaRecoveryName, 3) // Stop just the SQL thread on the replica - _, err = utils.RunSQL(t, "STOP SLAVE SQL_THREAD", replica, "") + _, err = utils.RunSQL(t, "STOP REPLICA SQL_THREAD", replica, "") require.NoError(t, err) // check replication is setup correctly @@ -191,10 +191,10 @@ func TestVTOrcRepairs(t *testing.T) { t.Run("ReplicationFromOtherReplica", func(t *testing.T) { // point replica at otherReplica changeReplicationSourceCommands := []string{ - "STOP SLAVE", - "RESET SLAVE ALL", - fmt.Sprintf("CHANGE MASTER TO MASTER_HOST='%s', MASTER_PORT=%d, MASTER_USER='vt_repl', MASTER_AUTO_POSITION = 1", utils.Hostname, otherReplica.MySQLPort), - "START SLAVE", + "STOP REPLICA", + "RESET REPLICA ALL", + fmt.Sprintf("CHANGE REPLICATION SOURCE TO SOURCE_HOST='%s', SOURCE_PORT=%d, SOURCE_USER='vt_repl', SOURCE_AUTO_POSITION = 1", utils.Hostname, otherReplica.MySQLPort), + "START REPLICA", } err := utils.RunSQLs(t, changeReplicationSourceCommands, replica, "") require.NoError(t, err) @@ -210,10 +210,10 @@ func TestVTOrcRepairs(t *testing.T) { t.Run("CircularReplication", func(t *testing.T) { // change the replication source on the primary changeReplicationSourceCommands := []string{ - "STOP SLAVE", - "RESET SLAVE ALL", - fmt.Sprintf("CHANGE MASTER TO MASTER_HOST='%s', MASTER_PORT=%d, MASTER_USER='vt_repl', MASTER_AUTO_POSITION = 1", replica.VttabletProcess.TabletHostname, replica.MySQLPort), - "START SLAVE", + "STOP REPLICA", + "RESET REPLICA ALL", + fmt.Sprintf("CHANGE REPLICATION SOURCE TO SOURCE_HOST='%s', SOURCE_PORT=%d, SOURCE_USER='vt_repl', SOURCE_AUTO_POSITION = 1", replica.VttabletProcess.TabletHostname, replica.MySQLPort), + "START REPLICA", } err := utils.RunSQLs(t, changeReplicationSourceCommands, curPrimary, "") require.NoError(t, err) diff --git a/go/test/endtoend/vtorc/readtopologyinstance/main_test.go b/go/test/endtoend/vtorc/readtopologyinstance/main_test.go index 78e4f4dfcda..fd7454365bd 100644 --- a/go/test/endtoend/vtorc/readtopologyinstance/main_test.go +++ b/go/test/endtoend/vtorc/readtopologyinstance/main_test.go @@ -108,11 +108,11 @@ func TestReadTopologyInstanceBufferable(t *testing.T) { // After this we restart the replication and enable the recoveries again. err = logic.DisableRecovery() require.NoError(t, err) - err = utils.RunSQLs(t, []string{`STOP SLAVE;`, + err = utils.RunSQLs(t, []string{`STOP REPLICA;`, `SET GTID_NEXT="12345678-1234-1234-1234-123456789012:1";`, `BEGIN;`, `COMMIT;`, `SET GTID_NEXT="AUTOMATIC";`, - `START SLAVE;`, + `START REPLICA;`, }, replica, "") require.NoError(t, err) err = logic.EnableRecovery() diff --git a/go/test/endtoend/vtorc/utils/utils.go b/go/test/endtoend/vtorc/utils/utils.go index 056276594d8..834efb41457 100644 --- a/go/test/endtoend/vtorc/utils/utils.go +++ b/go/test/endtoend/vtorc/utils/utils.go @@ -327,7 +327,7 @@ func cleanAndStartVttablet(t *testing.T, clusterInfo *VTOrcClusterInfo, vttablet _, err = RunSQL(t, "DROP DATABASE IF EXISTS _vt", vttablet, "") require.NoError(t, err) // stop the replication - _, err = RunSQL(t, "STOP SLAVE", vttablet, "") + _, err = RunSQL(t, "STOP REPLICA", vttablet, "") require.NoError(t, err) // reset the binlog _, err = RunSQL(t, "RESET MASTER", vttablet, "") @@ -502,7 +502,7 @@ func WaitForReplicationToStop(t *testing.T, vttablet *cluster.Vttablet) error { case <-timeout: return fmt.Errorf("timedout: waiting for primary to stop replication") default: - res, err := RunSQL(t, "SHOW SLAVE STATUS", vttablet, "") + res, err := RunSQL(t, "SHOW REPLICA STATUS", vttablet, "") if err != nil { return err } @@ -699,7 +699,7 @@ func CheckSourcePort(t *testing.T, replica *cluster.Vttablet, source *cluster.Vt t.Fatal("timedout waiting for correct primary to be setup") return default: - res, err := RunSQL(t, "SHOW SLAVE STATUS", replica, "") + res, err := RunSQL(t, "SHOW REPLICA STATUS", replica, "") require.NoError(t, err) if len(res.Rows) != 1 { @@ -708,7 +708,7 @@ func CheckSourcePort(t *testing.T, replica *cluster.Vttablet, source *cluster.Vt } for idx, field := range res.Fields { - if strings.EqualFold(field.Name, "MASTER_PORT") || strings.EqualFold(field.Name, "SOURCE_PORT") { + if strings.EqualFold(field.Name, "SOURCE_PORT") { port, err := res.Rows[0][idx].ToInt64() require.NoError(t, err) if port == int64(source.MySQLPort) { diff --git a/test.go b/test.go index d3a05468178..459a701b561 100755 --- a/test.go +++ b/test.go @@ -76,7 +76,7 @@ For example: // Flags var ( - flavor = flag.String("flavor", "mysql57", "comma-separated bootstrap flavor(s) to run against (when using Docker mode). Available flavors: all,"+flavors) + flavor = flag.String("flavor", "mysql80", "comma-separated bootstrap flavor(s) to run against (when using Docker mode). Available flavors: all,"+flavors) bootstrapVersion = flag.String("bootstrap-version", "31", "the version identifier to use for the docker images") runCount = flag.Int("runs", 1, "run each test this many times") retryMax = flag.Int("retry", 3, "max number of retries, to detect flaky tests")