From 25ec9f84b13328c557507982f3663da5dc275f78 Mon Sep 17 00:00:00 2001 From: Matt Lord Date: Mon, 16 Sep 2024 12:37:15 -0400 Subject: [PATCH] Minor changes on self review Signed-off-by: Matt Lord --- go/test/endtoend/vreplication/vreplication_test.go | 4 ++-- go/vt/vtctl/workflow/server.go | 2 +- go/vt/vttablet/tabletmanager/rpc_vreplication.go | 3 ++- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/go/test/endtoend/vreplication/vreplication_test.go b/go/test/endtoend/vreplication/vreplication_test.go index 8710db5d8f8..519bf8d0ce5 100644 --- a/go/test/endtoend/vreplication/vreplication_test.go +++ b/go/test/endtoend/vreplication/vreplication_test.go @@ -798,7 +798,7 @@ func shardCustomer(t *testing.T, testReverse bool, cells []*Cell, sourceCellOrAl commit, _ = vc.startQuery(t, openTxQuery) } switchWritesDryRun(t, workflowType, ksWorkflow, dryRunResultsSwitchWritesCustomerShard) - var shardNames []string + shardNames := make([]string, 0, len(vc.Cells[defaultCell.Name].Keyspaces[sourceKs].Shards)) for shardName := range maps.Keys(vc.Cells[defaultCell.Name].Keyspaces[sourceKs].Shards) { shardNames = append(shardNames, shardName) } @@ -1613,7 +1613,7 @@ func testSwitchTrafficPermissionChecks(t *testing.T, workflowType, sourceKeyspac } defer func() { - // Put global privs back in place. + // Put the default global privs back in place. applyPrivileges("grant select,insert,update,delete on *.* to vt_filtered@localhost") }() diff --git a/go/vt/vtctl/workflow/server.go b/go/vt/vtctl/workflow/server.go index f088d6cb4a3..87eb040bbbd 100644 --- a/go/vt/vtctl/workflow/server.go +++ b/go/vt/vtctl/workflow/server.go @@ -4330,7 +4330,7 @@ func (s *Server) validatePrimaryTabletsHaveRequiredVReplicationPermissions(ctx c defer wg.Done() tablet, err := s.ts.GetTablet(ctx, primary) if err != nil { - allErrors.RecordError(vterrors.Wrapf(err, "failed to get primary tablet for %s/%s shard", keyspace, shard.ShardName())) + allErrors.RecordError(vterrors.Wrapf(err, "failed to get primary tablet for the %s/%s shard", keyspace, shard.ShardName())) } // Ensure the tablet has the minimum privileges required on the sidecar database // table in order to manage the workflow. diff --git a/go/vt/vttablet/tabletmanager/rpc_vreplication.go b/go/vt/vttablet/tabletmanager/rpc_vreplication.go index 9f665ff604b..47c663e196a 100644 --- a/go/vt/vttablet/tabletmanager/rpc_vreplication.go +++ b/go/vt/vttablet/tabletmanager/rpc_vreplication.go @@ -78,7 +78,8 @@ where u.user = %a and find_in_set('update', t.table_priv) and find_in_set('delete', t.table_priv) ) - ) limit 1 + ) +limit 1 ` )