Skip to content
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

Using subring on getShardedRules when shuffle sharding #4466

Conversation

alanprot
Copy link
Member

@alanprot alanprot commented Sep 8, 2021

What this PR does:

GetRules API should call only the rulers on the tenant's subring when sharding strategy is set to ShardingStrategyShuffle.

Right now we are calling all rulers in the GetRules api even if the sharding strategy is set to ShardingStrategyShuffle. In this case, we should only call the rules in the tenant subring as those rules are the only ones that can load rules from this tenant. This change is specially important as right now we need all the rulers in the ring to be available or cortex will return an error - this means that if we have shardSize = 3 but 100 rulers in total, we will return 5xx if any of the 100 rules are down (for instance during deployment), even though the callers rules are spread only on 3 of them.

Which issue(s) this PR fixes:
Fixes #

Checklist

  • Tests updated
  • Documentation added
  • CHANGELOG.md updated - the order of entries should be [CHANGE], [FEATURE], [ENHANCEMENT], [BUGFIX]

@alanprot alanprot force-pushed the enhancement/using-subring-on-rulers-getShardedRules branch 6 times, most recently from b7a0438 to 4b4204e Compare September 8, 2021 15:05
Copy link
Member

@alvinlin123 alvinlin123 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you, LGTM.

CHANGELOG.md Outdated Show resolved Hide resolved
@alanprot alanprot force-pushed the enhancement/using-subring-on-rulers-getShardedRules branch from 1ed3818 to d3681b6 Compare September 10, 2021 19:46
Signed-off-by: Alan Protasio <approtas@amazon.com>
Signed-off-by: Alan Protasio <approtas@amazon.com>
@alanprot alanprot force-pushed the enhancement/using-subring-on-rulers-getShardedRules branch from d3681b6 to 25280c8 Compare September 10, 2021 21:35
@alanprot
Copy link
Member Author

Hi... Can i get some attention on this PR?

Situation like #4459 makes 100% of the APIs fail right now.

Copy link
Contributor

@bboreham bboreham left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

Copy link
Contributor

@pracucci pracucci left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense to me, thanks!

@bboreham bboreham merged commit c2ed27e into cortexproject:master Sep 15, 2021
srijan55 pushed a commit to srijan55/cortex that referenced this pull request Nov 26, 2021
…#4466)

* Using subring on getShardedRules when shuffle sharding

Signed-off-by: Alan Protasio <approtas@amazon.com>
Signed-off-by: Manish Kumar Gupta <manishkg@microsoft.com>
alvinlin123 pushed a commit to ac1214/cortex that referenced this pull request Jan 14, 2022
…#4466)

* Using subring on getShardedRules when shuffle sharding

Signed-off-by: Alan Protasio <approtas@amazon.com>
Signed-off-by: Alvin Lin <alvinlin@amazon.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants