Skip to content

Commit

Permalink
cleanup comments
Browse files Browse the repository at this point in the history
Signed-off-by: Tim Vaillancourt <[email protected]>
  • Loading branch information
timvaillancourt committed Feb 25, 2025
1 parent 8588aec commit 092ab7a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
6 changes: 4 additions & 2 deletions go/vt/vtorc/logic/keyspace_shard_discovery.go
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,8 @@ func refreshAllShards(ctx context.Context, keyspaceName string) error {
log.Error(err)
return err
}

// save shards that should be watched.
savedShards := make(map[string]bool, len(shardInfos))
for _, shardInfo := range shardInfos {
if !shouldWatchShard(shardInfo) {
Expand All @@ -182,10 +184,10 @@ func refreshAllShards(ctx context.Context, keyspaceName string) error {
savedShards[shardInfo.ShardName()] = true
}

// delete shards that were not returned by ts.FindAllShardsInKeyspace(...),
// indicating they are stale.
// delete shards that were not saved, indicating they are stale.
shards, err := inst.ReadShardNames(keyspaceName)
if err != nil {
log.Error(err)
return err
}
for _, shard := range shards {
Expand Down
4 changes: 0 additions & 4 deletions go/vt/vtorc/logic/keyspace_shard_discovery_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,11 +56,9 @@ func TestRefreshAllKeyspaces(t *testing.T) {
// Store the old flags and restore on test completion
oldTs := ts
oldClustersToWatch := clustersToWatch
oldShardsToWatch := shardsToWatch
defer func() {
ts = oldTs
clustersToWatch = oldClustersToWatch
shardsToWatch = oldShardsToWatch
}()

db.ClearVTOrcDatabase()
Expand Down Expand Up @@ -317,11 +315,9 @@ func verifyPrimaryAlias(t *testing.T, keyspaceName, shardName string, primaryAli
func TestRefreshAllShards(t *testing.T) {
// Store the old flags and restore on test completion
oldClustersToWatch := clustersToWatch
oldShardsToWatch := shardsToWatch
oldTs := ts
defer func() {
clustersToWatch = oldClustersToWatch
shardsToWatch = oldShardsToWatch
ts = oldTs
db.ClearVTOrcDatabase()
}()
Expand Down

0 comments on commit 092ab7a

Please sign in to comment.