@@ -41,6 +41,8 @@ func TestDefaultShardingStrategy(t *testing.T) {
41
41
zoneAwarenessEnabled bool
42
42
setupRing func (* ring.Desc )
43
43
expectedBlocks map [string ][]ulid.ULID
44
+ enableTenants []string
45
+ disableTenants []string
44
46
}{
45
47
"one ACTIVE instance in the ring with replication factor = 1" : {
46
48
replicationFactor : 1 ,
@@ -63,6 +65,19 @@ func TestDefaultShardingStrategy(t *testing.T) {
63
65
"127.0.0.2" : {block2 , block4 },
64
66
},
65
67
},
68
+ "two ACTIVE instances in the ring with replication factor = 1 and one tenant disabled" : {
69
+ replicationFactor : 1 ,
70
+ setupRing : func (r * ring.Desc ) {
71
+ r .AddIngester ("instance-1" , "127.0.0.1" , "" , []uint32 {block1Hash + 1 , block3Hash + 1 }, ring .ACTIVE , registeredAt )
72
+ r .AddIngester ("instance-2" , "127.0.0.2" , "" , []uint32 {block2Hash + 1 , block4Hash + 1 }, ring .ACTIVE , registeredAt )
73
+ },
74
+ enableTenants : []string {"instance-1" },
75
+ disableTenants : []string {"instance-2" },
76
+ expectedBlocks : map [string ][]ulid.ULID {
77
+ "127.0.0.1" : {block1 , block3 }, // Tenant 1 blocks expected
78
+ "127.0.0.2" : {}, // Tenant 2 blocks disabled
79
+ },
80
+ },
66
81
"one ACTIVE instance in the ring with replication factor = 2" : {
67
82
replicationFactor : 2 ,
68
83
setupRing : func (r * ring.Desc ) {
0 commit comments