Skip to content

Commit

Permalink
rename/cleanup
Browse files Browse the repository at this point in the history
Signed-off-by: Tim Vaillancourt <tim@timvaillancourt.com>
  • Loading branch information
timvaillancourt committed Feb 24, 2025
1 parent 4abcded commit e754104
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions go/vt/vtorc/logic/keyspace_shard_discovery.go
Original file line number Diff line number Diff line change
Expand Up @@ -109,19 +109,19 @@ func RefreshKeyspaceAndShard(keyspaceName string, shardName string) error {
return refreshShard(keyspaceName, shardName)
}

// shouldRefreshShard returns true if a shard is within the shardsToWatch
// shouldWatchShard returns true if a shard is within the shardsToWatch
// ranges for it's keyspace.
func shouldRefreshShard(keyspace, shardName string) (bool, error) {
func shouldWatchShard(shard *topo.ShardInfo) (bool, error) {
if len(shardsToWatch) == 0 {
return true, nil
}

watchRanges, found := shardsToWatch[keyspace]
watchRanges, found := shardsToWatch[shard.Keyspace()]
if !found {
return false, nil
}

shardRanges, err := key.ParseShardingSpec(shardName)
shardRanges, err := key.ParseShardingSpec(shard.ShardName())
if err != nil {
return false, err
}
Expand Down Expand Up @@ -180,7 +180,7 @@ func refreshAllShards(ctx context.Context, keyspaceName string) error {
savedShards := make(map[string]bool, len(shardInfos))
for _, shardInfo := range shardInfos {
shardName := shardInfo.ShardName()
shouldRefresh, err := shouldRefreshShard(keyspaceName, shardName)
shouldRefresh, err := shouldWatchShard(shardInfo)
if err != nil {
log.Error(err)
return err
Expand Down

0 comments on commit e754104

Please sign in to comment.