-
Notifications
You must be signed in to change notification settings - Fork 69
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
ring: add GetWithOptions method to adjust per call behavior #632
Conversation
35571f9
to
e17f2cc
Compare
6c1dec6
to
7b887a7
Compare
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.
only reviewed the prod changes so far
This change adds a new method that accepts 0 or more `Option` instances that modify the behavior of the call. These options can (currently) be used to adjust the replication factor for a particular key or use buffers to avoid excessive allocation. The most notable changes are in the `Ring.findInstancesForKey` method which is the core of the `Ring.Get` method. Instead of keeping track of distinct zones and assuming that only a single instance per zone would ever be returned, we keep a map of the number of instances found in each zone. Part of grafana/mimir#9944
Signed-off-by: Nick Pillitteri <[email protected]>
7b887a7
to
bf94082
Compare
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.
prod changes look good, I left some comments on the tests
Signed-off-by: Nick Pillitteri <[email protected]>
Signed-off-by: Nick Pillitteri <[email protected]>
This change uses the configured replication factor for the ring to determine the number of zones that should exist when zone-aware replication is enabled Signed-off-by: Nick Pillitteri <[email protected]>
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.
LGTM 🚀
Signed-off-by: Nick Pillitteri <[email protected]>
Pulls in grafana/dskit#632 Signed-off-by: Nick Pillitteri <[email protected]>
Pulls in grafana/dskit#632 Signed-off-by: Nick Pillitteri <[email protected]>
* Allow expanded replication set of TSDB blocks on store-gateways This change adds a tenant-specific setting to allow a subset of TSDB blocks to be replicated to more than the configured replication factor (three by default) on store-gateways. * mimir-microservices-mode: Use default store-gateway replication factor * Add grace period to expanded replication time range Much like how block uploads have a grace period, add a grace period when querying with expanded replication to make sure store-gateways have enough time to load blocks before they are queried. Signed-off-by: Nick Pillitteri <[email protected]> * Code review feedback Signed-off-by: Nick Pillitteri <[email protected]> * Apply grace period to max time _and_ upload time. Signed-off-by: Nick Pillitteri <[email protected]> * Don't check upload time in expanded replication Upload time is checked (and blocks within a grace period are ignored) by the query consistency check. Signed-off-by: Nick Pillitteri <[email protected]> * Code review changes Apply grace period to sync instead of querying Signed-off-by: Nick Pillitteri <[email protected]> * Rename feature to "dynamic_replication" Signed-off-by: Nick Pillitteri <[email protected]> * Fix comment about how grace period works Signed-off-by: Nick Pillitteri <[email protected]> * Update comments about dynamic replication grace period Signed-off-by: Nick Pillitteri <[email protected]> * Update to latest dskit commit Signed-off-by: Nick Pillitteri <[email protected]> * Switch to latest dskit main Pulls in grafana/dskit#632 Signed-off-by: Nick Pillitteri <[email protected]> * Code review changes Signed-off-by: Nick Pillitteri <[email protected]> --------- Signed-off-by: Nick Pillitteri <[email protected]>
What this PR does:
This change adds a new method that accepts 0 or more
Option
instances that modify the behavior of the call. These options can (currently) be used to adjust the replication factor for a particular key or use buffers to avoid excessive allocation.The most notable changes are in the
Ring.findInstancesForKey
method which is the core of theRing.Get
method. Instead of keeping track of distinct zones and assuming that only a single instance per zone would ever be returned, we keep a map of the number of instances found in each zone.Which issue(s) this PR fixes:
Part of grafana/mimir#9944
Previous attempt #620
Checklist
CHANGELOG.md
updated - the order of entries should be[CHANGE]
,[FEATURE]
,[ENHANCEMENT]
,[BUGFIX]