Skip to content

Commit

Permalink
Merge pull request #7115 from planetscale/ds-7109
Browse files Browse the repository at this point in the history
remove deprecated vtctl commands, flags and vttablet rpcs
  • Loading branch information
deepthi authored Dec 4, 2020
2 parents 8b42614 + 400acf3 commit 99f9fb4
Show file tree
Hide file tree
Showing 22 changed files with 231 additions and 2,021 deletions.
13 changes: 4 additions & 9 deletions go/cmd/vtctld/schema.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,10 @@ import (
)

var (
schemaChangeDir = flag.String("schema_change_dir", "", "directory contains schema changes for all keyspaces. Each keyspace has its own directory and schema changes are expected to live in '$KEYSPACE/input' dir. e.g. test_keyspace/input/*sql, each sql file represents a schema change")
schemaChangeController = flag.String("schema_change_controller", "", "schema change controller is responsible for finding schema changes and responding to schema change events")
schemaChangeCheckInterval = flag.Int("schema_change_check_interval", 60, "this value decides how often we check schema change dir, in seconds")
schemaChangeUser = flag.String("schema_change_user", "", "The user who submits this schema change.")
// for backwards compatibility
deprecatedTimeout = flag.Duration("schema_change_slave_timeout", wrangler.DefaultWaitReplicasTimeout, "DEPRECATED -- use -schema_change_replicas_timeout instead")
schemaChangeDir = flag.String("schema_change_dir", "", "directory contains schema changes for all keyspaces. Each keyspace has its own directory and schema changes are expected to live in '$KEYSPACE/input' dir. e.g. test_keyspace/input/*sql, each sql file represents a schema change")
schemaChangeController = flag.String("schema_change_controller", "", "schema change controller is responsible for finding schema changes and responding to schema change events")
schemaChangeCheckInterval = flag.Int("schema_change_check_interval", 60, "this value decides how often we check schema change dir, in seconds")
schemaChangeUser = flag.String("schema_change_user", "", "The user who submits this schema change.")
schemaChangeReplicasTimeout = flag.Duration("schema_change_replicas_timeout", wrangler.DefaultWaitReplicasTimeout, "how long to wait for replicas to receive the schema change")
)

Expand All @@ -48,9 +46,6 @@ func initSchema() {
if *schemaChangeCheckInterval > 0 {
interval = *schemaChangeCheckInterval
}
if *deprecatedTimeout != 10*time.Second {
*schemaChangeReplicasTimeout = *deprecatedTimeout
}
timer := timer.NewTimer(time.Duration(interval) * time.Second)
controllerFactory, err :=
schemamanager.GetControllerFactory(*schemaChangeController)
Expand Down
3 changes: 1 addition & 2 deletions go/test/endtoend/reparent/reparent_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -374,8 +374,7 @@ func TestChangeTypeSemiSync(t *testing.T) {
master, replica, rdonly1, rdonly2 := tab1, tab2, tab3, tab4

// Updated rdonly tablet and set tablet type to rdonly
// TODO: replace with ChangeTabletType once ChangeSlaveType is removed
err := clusterInstance.VtctlclientProcess.ExecuteCommand("ChangeSlaveType", rdonly1.Alias, "rdonly")
err := clusterInstance.VtctlclientProcess.ExecuteCommand("ChangeTabletType", rdonly1.Alias, "rdonly")
require.NoError(t, err)
err = clusterInstance.VtctlclientProcess.ExecuteCommand("ChangeTabletType", rdonly2.Alias, "rdonly")
require.NoError(t, err)
Expand Down
4 changes: 2 additions & 2 deletions go/test/endtoend/reparent/utils_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -384,8 +384,8 @@ func checkDBstatus(ctx context.Context, t *testing.T, tablet *cluster.Vttablet,

func checkReplicaStatus(ctx context.Context, t *testing.T, tablet *cluster.Vttablet) {
qr := runSQL(ctx, t, "show slave status", tablet)
IOThreadRunning := fmt.Sprintf("%v", qr.Rows[0][10]) // Slave_IO_Running
SQLThreadRunning := fmt.Sprintf("%v", qr.Rows[0][10]) // Slave_SQL_Running
IOThreadRunning := fmt.Sprintf("%v", qr.Rows[0][10])
SQLThreadRunning := fmt.Sprintf("%v", qr.Rows[0][10])
assert.Equal(t, IOThreadRunning, "VARCHAR(\"No\")")
assert.Equal(t, SQLThreadRunning, "VARCHAR(\"No\")")
}
Expand Down
12 changes: 6 additions & 6 deletions go/test/endtoend/sharding/mergesharding/mergesharding_base.go
Original file line number Diff line number Diff line change
Expand Up @@ -319,9 +319,9 @@ func TestMergesharding(t *testing.T, useVarbinaryShardingKeyType bool) {
require.NoError(t, err)

// Change tablet, which was taken offline, back to rdonly.
err = clusterInstance.VtctlclientProcess.ExecuteCommand("ChangeSlaveType", shard0Rdonly.Alias, "rdonly")
err = clusterInstance.VtctlclientProcess.ExecuteCommand("ChangeTabletType", shard0Rdonly.Alias, "rdonly")
require.NoError(t, err)
err = clusterInstance.VtctlclientProcess.ExecuteCommand("ChangeSlaveType", shard1Rdonly.Alias, "rdonly")
err = clusterInstance.VtctlclientProcess.ExecuteCommand("ChangeTabletType", shard1Rdonly.Alias, "rdonly")
require.NoError(t, err)

// Terminate worker daemon because it is no longer needed.
Expand Down Expand Up @@ -391,9 +391,9 @@ func TestMergesharding(t *testing.T, useVarbinaryShardingKeyType bool) {
shard3Ks)
require.NoError(t, err)

err = clusterInstance.VtctlclientProcess.ExecuteCommand("ChangeSlaveType", shard0Rdonly.Alias, "rdonly")
err = clusterInstance.VtctlclientProcess.ExecuteCommand("ChangeTabletType", shard0Rdonly.Alias, "rdonly")
require.NoError(t, err)
err = clusterInstance.VtctlclientProcess.ExecuteCommand("ChangeSlaveType", shard3Rdonly.Alias, "rdonly")
err = clusterInstance.VtctlclientProcess.ExecuteCommand("ChangeTabletType", shard3Rdonly.Alias, "rdonly")
require.NoError(t, err)

log.Debug("Running vtworker SplitDiff on second half")
Expand All @@ -408,9 +408,9 @@ func TestMergesharding(t *testing.T, useVarbinaryShardingKeyType bool) {
shard3Ks)
require.NoError(t, err)

err = clusterInstance.VtctlclientProcess.ExecuteCommand("ChangeSlaveType", shard1Rdonly.Alias, "rdonly")
err = clusterInstance.VtctlclientProcess.ExecuteCommand("ChangeTabletType", shard1Rdonly.Alias, "rdonly")
require.NoError(t, err)
err = clusterInstance.VtctlclientProcess.ExecuteCommand("ChangeSlaveType", shard3Rdonly.Alias, "rdonly")
err = clusterInstance.VtctlclientProcess.ExecuteCommand("ChangeTabletType", shard3Rdonly.Alias, "rdonly")
require.NoError(t, err)

sharding.CheckTabletQueryService(t, *shard3Master, "NOT_SERVING", false, *clusterInstance)
Expand Down
16 changes: 8 additions & 8 deletions go/test/endtoend/sharding/resharding/resharding_base.go
Original file line number Diff line number Diff line change
Expand Up @@ -372,7 +372,7 @@ func TestResharding(t *testing.T, useVarbinaryShardingKeyType bool) {
sharding.CheckSrvKeyspace(t, cell1, keyspaceName, "", 0, expectedPartitions, *clusterInstance)

// disable shard1Replica2, so we're sure filtered replication will go from shard1Replica1
err = clusterInstance.VtctlclientProcess.ExecuteCommand("ChangeSlaveType", shard1Replica2.Alias, "spare")
err = clusterInstance.VtctlclientProcess.ExecuteCommand("ChangeTabletType", shard1Replica2.Alias, "spare")
require.Nil(t, err)

err = shard1Replica2.VttabletProcess.WaitForTabletType("NOT_SERVING")
Expand Down Expand Up @@ -486,7 +486,7 @@ func TestResharding(t *testing.T, useVarbinaryShardingKeyType bool) {
require.Nil(t, err)

// Change tablet, which was taken offline, back to rdonly.
err = clusterInstance.VtctlclientProcess.ExecuteCommand("ChangeSlaveType", shard1Rdonly.Alias, "rdonly")
err = clusterInstance.VtctlclientProcess.ExecuteCommand("ChangeTabletType", shard1Rdonly.Alias, "rdonly")
require.Nil(t, err)

// Terminate worker daemon because it is no longer needed.
Expand Down Expand Up @@ -585,15 +585,15 @@ func TestResharding(t *testing.T, useVarbinaryShardingKeyType bool) {
shard1Ks)
require.Nil(t, err)

err = clusterInstance.VtctlclientProcess.ExecuteCommand("ChangeSlaveType", shard1Rdonly.Alias, "rdonly")
err = clusterInstance.VtctlclientProcess.ExecuteCommand("ChangeTabletType", shard1Rdonly.Alias, "rdonly")
require.Nil(t, err)
err = clusterInstance.VtctlclientProcess.ExecuteCommand("ChangeSlaveType", shard3Rdonly.Alias, "rdonly")
err = clusterInstance.VtctlclientProcess.ExecuteCommand("ChangeTabletType", shard3Rdonly.Alias, "rdonly")
require.Nil(t, err)

// tests a failover switching serving to a different replica
err = clusterInstance.VtctlclientProcess.ExecuteCommand("ChangeSlaveType", shard1Replica2.Alias, "replica")
err = clusterInstance.VtctlclientProcess.ExecuteCommand("ChangeTabletType", shard1Replica2.Alias, "replica")
require.Nil(t, err)
err = clusterInstance.VtctlclientProcess.ExecuteCommand("ChangeSlaveType", shard1Replica1.Alias, "spare")
err = clusterInstance.VtctlclientProcess.ExecuteCommand("ChangeTabletType", shard1Replica1.Alias, "spare")
require.Nil(t, err)

err = shard1Replica2.VttabletProcess.WaitForTabletType("SERVING")
Expand Down Expand Up @@ -791,9 +791,9 @@ func TestResharding(t *testing.T, useVarbinaryShardingKeyType bool) {
shard1Ks)
require.Nil(t, err)

err = clusterInstance.VtctlclientProcess.ExecuteCommand("ChangeSlaveType", shard1Rdonly.Alias, "rdonly")
err = clusterInstance.VtctlclientProcess.ExecuteCommand("ChangeTabletType", shard1Rdonly.Alias, "rdonly")
require.Nil(t, err)
err = clusterInstance.VtctlclientProcess.ExecuteCommand("ChangeSlaveType", shard3Rdonly.Alias, "rdonly")
err = clusterInstance.VtctlclientProcess.ExecuteCommand("ChangeTabletType", shard3Rdonly.Alias, "rdonly")
require.Nil(t, err)

// going to migrate the master now
Expand Down
5 changes: 2 additions & 3 deletions go/test/endtoend/tabletmanager/tablet_health_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -125,8 +125,7 @@ func TestHealthCheck(t *testing.T) {
exec(t, masterConn, "stop slave")

// stop replication, make sure we don't go unhealthy.
// TODO: replace with StopReplication once StopSlave has been removed
err = clusterInstance.VtctlclientProcess.ExecuteCommand("StopSlave", rTablet.Alias)
err = clusterInstance.VtctlclientProcess.ExecuteCommand("StopReplication", rTablet.Alias)
require.NoError(t, err)
err = clusterInstance.VtctlclientProcess.ExecuteCommand("RunHealthCheck", rTablet.Alias)
require.NoError(t, err)
Expand Down Expand Up @@ -237,7 +236,7 @@ func TestHealthCheckDrainedStateDoesNotShutdownQueryService(t *testing.T) {
// Restart replication. Tablet will become healthy again.
err = clusterInstance.VtctlclientProcess.ExecuteCommand("ChangeTabletType", rdonlyTablet.Alias, "rdonly")
require.NoError(t, err)
err = clusterInstance.VtctlclientProcess.ExecuteCommand("StartSlave", rdonlyTablet.Alias)
err = clusterInstance.VtctlclientProcess.ExecuteCommand("StartReplication", rdonlyTablet.Alias)
require.NoError(t, err)
err = clusterInstance.VtctlclientProcess.ExecuteCommand("RunHealthCheck", rdonlyTablet.Alias)
require.NoError(t, err)
Expand Down
3 changes: 0 additions & 3 deletions go/vt/proto/binlogdata/binlogdata.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 99f9fb4

Please sign in to comment.