-
Notifications
You must be signed in to change notification settings - Fork 818
add/support enabled_tenants and disabled_tenants feature in storegateway #5186
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add/support enabled_tenants and disabled_tenants feature in storegateway #5186
Conversation
@friedrichg Do I need to create a new function to filter out users that are not allowed? |
@friedrichg Is there a function/map that stores all the incoming users in the bucket? I tried finding it in the |
@moki1202 filterUsers function is already in the right places
cortex/pkg/storegateway/bucket_stores.go Line 212 in 47733dd
Concentrate making changes on https://github.com/cortexproject/cortex/blob/master/pkg/storegateway/sharding_strategy.go |
understood! I'll try this. |
b38ba42
to
6054659
Compare
6054659
to
a8bd542
Compare
a8bd542
to
1e179ec
Compare
Signed-off-by: Shashank <[email protected]>
1e179ec
to
a18fcd9
Compare
Signed-off-by: Shashank <[email protected]>
a18fcd9
to
204f95c
Compare
@friedrichg I've tried a lot but I am struggling while updating the tests. Can you please help me out here? I would just ask for your help in updating the defaultShardingStrategy tests. I'll try doing the other ones after. |
@@ -107,6 +119,12 @@ func (s *ShuffleShardingStrategy) FilterUsers(_ context.Context, userIDs []strin | |||
for _, userID := range userIDs { | |||
subRing := GetShuffleShardingSubring(s.r, userID, s.limits) | |||
|
|||
//filter out users not owned by this shard. | |||
if !s.allowedTenants.IsAllowed(userID) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, we need the GetShuffleShardingSubring on the filtered users, otherwise we might end up with store-gateways running without users
@@ -64,6 +67,21 @@ func TestDefaultShardingStrategy(t *testing.T) { | |||
"127.0.0.2": {block2, block4}, | |||
}, | |||
}, | |||
"two ACTIVE instances in the ring with replication factor = 1 and one tenant disabled": { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unfortunately, this function does not test FilterUsers, it tests FilterBlocks. So this is not the right place
Thanks, partially included in #5638 |
Signed-off-by: Shashank [email protected]
What this PR does: Now adds/supports
enabled_tenants
anddisabled_tenants
in packagestoregateway
Fixes #5133
Checklist
CHANGELOG.md
updated - the order of entries should be[CHANGE]
,[FEATURE]
,[ENHANCEMENT]
,[BUGFIX]
PR still in progress.