Skip to content

Commit

Permalink
endtoend: Remove usage of deprecated terminology
Browse files Browse the repository at this point in the history
Now that we don't run these tests anymore against old MySQL 5.7 releases
we can update the terminology used.

Signed-off-by: Dirkjan Bussink <d.bussink@gmail.com>
  • Loading branch information
dbussink committed May 1, 2024
1 parent 23869ed commit be0f0ad
Show file tree
Hide file tree
Showing 11 changed files with 41 additions and 41 deletions.
6 changes: 3 additions & 3 deletions go/test/endtoend/reparent/emergencyreparent/ers_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
14 changes: 7 additions & 7 deletions go/test/endtoend/reparent/plannedreparent/reparent_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 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]})
Expand Down Expand Up @@ -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
Expand All @@ -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 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])

Expand All @@ -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])

Expand Down
4 changes: 2 additions & 2 deletions go/test/endtoend/reparent/utils/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -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\")")
Expand Down Expand Up @@ -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 {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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"
)
Expand Down Expand Up @@ -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)
Expand Down
8 changes: 4 additions & 4 deletions go/test/endtoend/tabletgateway/vtgate_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion go/test/endtoend/tabletmanager/tablet_health_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
6 changes: 3 additions & 3 deletions go/test/endtoend/tabletmanager/tablet_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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)
}
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
20 changes: 10 additions & 10 deletions go/test/endtoend/vtorc/general/vtorc_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -172,15 +172,15 @@ 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
utils.CheckReplication(t, clusterInfo, curPrimary, []*cluster.Vttablet{replica, otherReplica}, 15*time.Second)
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
Expand All @@ -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 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)
Expand All @@ -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 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)
Expand Down
4 changes: 2 additions & 2 deletions go/test/endtoend/vtorc/readtopologyinstance/main_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
8 changes: 4 additions & 4 deletions go/test/endtoend/vtorc/utils/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -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, "")
Expand Down Expand Up @@ -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
}
Expand Down Expand Up @@ -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 {
Expand All @@ -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) {
Expand Down

0 comments on commit be0f0ad

Please sign in to comment.