Skip to content

Conversation

pracucci
Copy link
Contributor

@pracucci pracucci commented Nov 4, 2020

What this PR does:
In the PR #3414 we're working to add zone-awareness support to Ring.GetAll(). The new logic (which triggers when zone-awareness replication is enabled) is not safe to apply in all contexts where GetAll() is used.

The reason is that GetAll() is currently used for two very distinct purposes:

  1. Get a view over the ring (all healthy instances)
  2. Get the set of instances (ingesters) to query for a given operation

The zone-awareness logic should apply to (2) but not to (1).

In this PR, I'm proposing to split GetAll() into GetAllHealthy() (to cover case 1) and GetReplicationSetForOperation() (to cover case 2). The reason why I renamed GetAll() into GetReplicationSetForOperation() is so that we can signal downstream projects about this change and let them take an informed decision whether should be used one or the other one.

Which issue(s) this PR fixes:
N/A

Checklist

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

Copy link
Contributor

@pstibrany pstibrany left a comment

Choose a reason for hiding this comment

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

I was just wondering about this the other day, thanks for splitting it! LGTM, with some nits.

Signed-off-by: Marco Pracucci <[email protected]>
Signed-off-by: Marco Pracucci <[email protected]>
@pracucci pracucci marked this pull request as ready for review November 4, 2020 15:46
@pracucci
Copy link
Contributor Author

pracucci commented Nov 4, 2020

@pstibrany Thanks for your review! I addressed your comments and should be ready for a second pass review 🙏

Copy link
Contributor

@MichelHollands MichelHollands 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

@pstibrany pstibrany left a comment

Choose a reason for hiding this comment

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

LGTM, thanks!

@pracucci pracucci merged commit e69d628 into cortexproject:master Nov 4, 2020
@pracucci pracucci deleted the refactor-ring-get-all branch November 4, 2020 16:31
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.

3 participants