File tree Expand file tree Collapse file tree 1 file changed +14
-3
lines changed Expand file tree Collapse file tree 1 file changed +14
-3
lines changed Original file line number Diff line number Diff line change @@ -786,12 +786,23 @@ func (c *Compactor) ownUser(userID string) (bool, error) {
786786 return false , nil
787787 }
788788
789- // Always owned if sharding is disabled or if using shuffle-sharding as shard ownership
790- // is determined by the shuffle sharding grouper.
791- if ! c .compactorCfg .ShardingEnabled || c .compactorCfg .ShardingStrategy == util .ShardingStrategyShuffle {
789+ // Always owned if sharding is disabled.
790+ if ! c .compactorCfg .ShardingEnabled {
792791 return true , nil
793792 }
794793
794+ // If using shuffle-sharding as shard ownership
795+ // is determined by the shuffle sharding grouper.
796+ if c .compactorCfg .ShardingStrategy == util .ShardingStrategyShuffle {
797+ subRing := c .ring .ShuffleShard (userID , c .limits .CompactorTenantShardSize (userID ))
798+
799+ rs , err := subRing .GetAllHealthy (RingOp )
800+ if err != nil {
801+ return false , err
802+ }
803+
804+ return rs .Includes (c .ringLifecycler .Addr ), nil
805+ }
795806 // Hash the user ID.
796807 hasher := fnv .New32a ()
797808 _ , _ = hasher .Write ([]byte (userID ))
You can’t perform that action at this time.
0 commit comments