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 @@ -818,12 +818,23 @@ func (c *Compactor) ownUser(userID string) (bool, error) {
818818 return false , nil
819819 }
820820
821- // Always owned if sharding is disabled or if using shuffle-sharding as shard ownership
822- // is determined by the shuffle sharding grouper.
823- if ! c .compactorCfg .ShardingEnabled || c .compactorCfg .ShardingStrategy == util .ShardingStrategyShuffle {
821+ // Always owned if sharding is disabled
822+ if ! c .compactorCfg .ShardingEnabled {
824823 return true , nil
825824 }
826825
826+ // If using shuffle-sharding, ownership is determined by the ring
827+ if c .compactorCfg .ShardingStrategy == util .ShardingStrategyShuffle {
828+ subRing := c .ring .ShuffleShard (userID , c .limits .CompactorTenantShardSize (userID ))
829+
830+ rs , err := subRing .GetAllHealthy (RingOp )
831+ if err != nil {
832+ return false , err
833+ }
834+
835+ return rs .Includes (c .ringLifecycler .Addr ), nil
836+ }
837+
827838 // Hash the user ID.
828839 hasher := fnv .New32a ()
829840 _ , _ = hasher .Write ([]byte (userID ))
You can’t perform that action at this time.
0 commit comments