diff --git a/go/test/endtoend/vreplication/vreplication_test_env.go b/go/test/endtoend/vreplication/vreplication_test_env.go index eb196227094..cbfd02f42cc 100644 --- a/go/test/endtoend/vreplication/vreplication_test_env.go +++ b/go/test/endtoend/vreplication/vreplication_test_env.go @@ -19,14 +19,14 @@ package vreplication var dryRunResultsSwitchWritesCustomerShard = []string{ "Lock keyspace product", "Lock keyspace customer", - "Stop writes on keyspace product, tables customer:", + "Stop writes on keyspace product, tables [customer]:", "/ Keyspace product, Shard 0 at Position", "Wait for VReplication on stopped streams to catchup for upto 30s", "Create reverse replication workflow p2c_reverse", "Create journal entries on source databases", - "Enable writes on keyspace customer tables customer", + "Enable writes on keyspace customer tables [customer]", "Switch routing from keyspace product to keyspace customer", - "Routing rules for tables customer will be updated", + "Routing rules for tables [customer] will be updated", "SwitchWrites completed, freeze and delete vreplication streams on:", " tablet 200 ", " tablet 300 ", @@ -41,8 +41,8 @@ var dryRunResultsSwitchWritesCustomerShard = []string{ var dryRunResultsReadCustomerShard = []string{ "Lock keyspace product", - "Switch reads for tables customer to keyspace customer for tablet types REPLICA", - "Routing rules for tables customer will be updated", + "Switch reads for tables [customer] to keyspace customer for tablet types [REPLICA]", + "Routing rules for tables [customer] will be updated", "Unlock keyspace product", } @@ -57,13 +57,13 @@ var dryRunResultsSwitchWritesM2m3 = []string{ "/ Id 4 Keyspace customer Shard -80 Rules rules: at Position ", "/ Id 5 Keyspace customer Shard 80- Rules rules: at Position ", "/ Id 5 Keyspace customer Shard 80- Rules rules: at Position ", - "Stop writes on keyspace merchant, tables /.*:", + "Stop writes on keyspace merchant, tables [/.*]:", "/ Keyspace merchant, Shard -80 at Position", "/ Keyspace merchant, Shard 80- at Position", "Wait for VReplication on stopped streams to catchup for upto 30s", "Create reverse replication workflow m2m3_reverse", "Create journal entries on source databases", - "Enable writes on keyspace merchant tables /.*", + "Enable writes on keyspace merchant tables [/.*]", "Switch routing from keyspace merchant to keyspace merchant", "IsMasterServing will be set to false for:", " Shard -80, Tablet 400 ", @@ -91,7 +91,7 @@ var dryRunResultsDropSourcesDropCustomerShard = []string{ "Lock keyspace customer", "Dropping these tables from the database and removing them from the vschema for keyspace product:", " Keyspace product Shard 0 DbName vt_product Tablet 100 Table customer", - "Blacklisted tables customer will be removed from:", + "Blacklisted tables [customer] will be removed from:", " Keyspace product Shard 0 Tablet 100", "Delete reverse vreplication streams on source:", " Keyspace product Shard 0 Workflow p2c_reverse DbName vt_product Tablet 100", @@ -108,7 +108,7 @@ var dryRunResultsDropSourcesRenameCustomerShard = []string{ "Lock keyspace customer", "Renaming these tables from the database and removing them from the vschema for keyspace product:", " Keyspace product Shard 0 DbName vt_product Tablet 100 Table customer", - "Blacklisted tables customer will be removed from:", + "Blacklisted tables [customer] will be removed from:", " Keyspace product Shard 0 Tablet 100", "Delete reverse vreplication streams on source:", " Keyspace product Shard 0 Workflow p2c_reverse DbName vt_product Tablet 100", diff --git a/go/vt/wrangler/switcher_dry_run.go b/go/vt/wrangler/switcher_dry_run.go index 9e1e101fc7c..6f7a505ce6c 100644 --- a/go/vt/wrangler/switcher_dry_run.go +++ b/go/vt/wrangler/switcher_dry_run.go @@ -73,9 +73,9 @@ func (dr *switcherDryRun) switchTableReads(ctx context.Context, cells []string, tabletTypes = append(tabletTypes, servedType.String()) } tables := strings.Join(dr.ts.tables, ",") - dr.drLog.Log(fmt.Sprintf("Switch reads for tables %s to keyspace %s for tablet types %s", + dr.drLog.Log(fmt.Sprintf("Switch reads for tables [%s] to keyspace %s for tablet types [%s]", tables, ks, strings.Join(tabletTypes, ","))) - dr.drLog.Log(fmt.Sprintf("Routing rules for tables %s will be updated", tables)) + dr.drLog.Log(fmt.Sprintf("Routing rules for tables [%s] will be updated", tables)) return nil } @@ -89,7 +89,7 @@ func (dr *switcherDryRun) createJournals(ctx context.Context, sourceWorkflows [] } func (dr *switcherDryRun) allowTargetWrites(ctx context.Context) error { - dr.drLog.Log(fmt.Sprintf("Enable writes on keyspace %s tables %s", dr.ts.targetKeyspace, strings.Join(dr.ts.tables, ","))) + dr.drLog.Log(fmt.Sprintf("Enable writes on keyspace %s tables [%s]", dr.ts.targetKeyspace, strings.Join(dr.ts.tables, ","))) return nil } @@ -98,7 +98,7 @@ func (dr *switcherDryRun) changeRouting(ctx context.Context) error { var deleteLogs, addLogs []string if dr.ts.migrationType == binlogdatapb.MigrationType_TABLES { tables := strings.Join(dr.ts.tables, ",") - dr.drLog.Log(fmt.Sprintf("Routing rules for tables %s will be updated", tables)) + dr.drLog.Log(fmt.Sprintf("Routing rules for tables [%s] will be updated", tables)) return nil } deleteLogs = nil @@ -186,7 +186,7 @@ func (dr *switcherDryRun) stopSourceWrites(ctx context.Context) error { logs = append(logs, fmt.Sprintf("\tKeyspace %s, Shard %s at Position %s", dr.ts.sourceKeyspace, source.si.ShardName(), position)) } if len(logs) > 0 { - dr.drLog.Log(fmt.Sprintf("Stop writes on keyspace %s, tables %s:", dr.ts.sourceKeyspace, strings.Join(dr.ts.tables, ","))) + dr.drLog.Log(fmt.Sprintf("Stop writes on keyspace %s, tables [%s]:", dr.ts.sourceKeyspace, strings.Join(dr.ts.tables, ","))) dr.drLog.LogSlice(logs) } return nil @@ -307,7 +307,7 @@ func (dr *switcherDryRun) dropSourceBlacklistedTables(ctx context.Context) error logs = append(logs, fmt.Sprintf("\tKeyspace %s Shard %s Tablet %d", si.Keyspace(), si.ShardName(), si.MasterAlias.Uid)) } if len(logs) > 0 { - dr.drLog.Log(fmt.Sprintf("Blacklisted tables %s will be removed from:", strings.Join(dr.ts.tables, ","))) + dr.drLog.Log(fmt.Sprintf("Blacklisted tables [%s] will be removed from:", strings.Join(dr.ts.tables, ","))) dr.drLog.LogSlice(logs) } return nil diff --git a/go/vt/wrangler/traffic_switcher_test.go b/go/vt/wrangler/traffic_switcher_test.go index e5e40aaf79a..5760220a8b8 100644 --- a/go/vt/wrangler/traffic_switcher_test.go +++ b/go/vt/wrangler/traffic_switcher_test.go @@ -861,7 +861,7 @@ func TestTableMigrateOneToMany(t *testing.T) { "Dropping these tables from the database and removing them from the vschema for keyspace ks1:", " Keyspace ks1 Shard 0 DbName vt_ks1 Tablet 10 Table t1", " Keyspace ks1 Shard 0 DbName vt_ks1 Tablet 10 Table t2", - "Blacklisted tables t1,t2 will be removed from:", + "Blacklisted tables [t1,t2] will be removed from:", " Keyspace ks1 Shard 0 Tablet 10", "Delete reverse vreplication streams on source:", " Keyspace ks1 Shard 0 Workflow test_reverse DbName vt_ks1 Tablet 10", @@ -888,7 +888,7 @@ func TestTableMigrateOneToMany(t *testing.T) { "Renaming these tables from the database and removing them from the vschema for keyspace ks1:", " " + "Keyspace ks1 Shard 0 DbName vt_ks1 Tablet 10 Table t1", " Keyspace ks1 Shard 0 DbName vt_ks1 Tablet 10 Table t2", - "Blacklisted tables t1,t2 will be removed from:", + "Blacklisted tables [t1,t2] will be removed from:", " Keyspace ks1 Shard 0 Tablet 10", "Delete reverse vreplication streams on source:", " Keyspace ks1 Shard 0 Workflow test_reverse DbName vt_ks1 Tablet 10", @@ -930,21 +930,21 @@ func TestTableMigrateOneToManyDryRun(t *testing.T) { wantdryRunReads := []string{ "Lock keyspace ks1", - "Switch reads for tables t1,t2 to keyspace ks2 for tablet types RDONLY", - "Routing rules for tables t1,t2 will be updated", + "Switch reads for tables [t1,t2] to keyspace ks2 for tablet types [RDONLY]", + "Routing rules for tables [t1,t2] will be updated", "Unlock keyspace ks1", } wantdryRunWrites := []string{ "Lock keyspace ks1", "Lock keyspace ks2", - "Stop writes on keyspace ks1, tables t1,t2:", + "Stop writes on keyspace ks1, tables [t1,t2]:", "\tKeyspace ks1, Shard 0 at Position MariaDB/5-456-892", "Wait for VReplication on stopped streams to catchup for upto 1s", "Create reverse replication workflow test_reverse", "Create journal entries on source databases", - "Enable writes on keyspace ks2 tables t1,t2", + "Enable writes on keyspace ks2 tables [t1,t2]", "Switch routing from keyspace ks1 to keyspace ks2", - "Routing rules for tables t1,t2 will be updated", + "Routing rules for tables [t1,t2] will be updated", "SwitchWrites completed, freeze and delete vreplication streams on:", " tablet 20", " tablet 30",