File tree 1 file changed +14
-3
lines changed
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) {
786
786
return false , nil
787
787
}
788
788
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 {
792
791
return true , nil
793
792
}
794
793
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
+ }
795
806
// Hash the user ID.
796
807
hasher := fnv .New32a ()
797
808
_ , _ = hasher .Write ([]byte (userID ))
You can’t perform that action at this time.
0 commit comments