Option to include quorum zone results for DistributorQueryable metadata API#5779
Merged
Conversation
Signed-off-by: Ben Ye <benye@amazon.com>
Signed-off-by: Ben Ye <benye@amazon.com>
Signed-off-by: Ben Ye <benye@amazon.com>
alanprot
reviewed
Feb 21, 2024
Comment on lines
+86
to
+89
| if _, ok := resultsPerZone[res.instance.Zone]; !ok { | ||
| resultsPerZone[res.instance.Zone] = make([]interface{}, 0, len(r.Instances)) | ||
| } | ||
| resultsPerZone[res.instance.Zone] = append(resultsPerZone[res.instance.Zone], res.res) |
Member
There was a problem hiding this comment.
Is it possible to have 2 new methods on the tracker interface to hide this logic?
- tracker.RecordResult(instance, result)
- GetQuerumResults
- That for sone aware will return only the zonal results?
Contributor
Author
There was a problem hiding this comment.
Updated. I combine RecordResult to the existing done method.
GetResults is a general method to return results. Quorum or not is controlled via the flag
Signed-off-by: Ben Ye <benye@amazon.com>
Member
|
LGTM!! Nice work! |
alanprot
approved these changes
Feb 21, 2024
Signed-off-by: Ben Ye <benye@amazon.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What this PR does:
Added a new flag
-distributor.zone-results-quorum-metadatato only include quorum number of zones as query results of metadata APIs like label names, values and series.This helps improve performance and latency. Image we have 3 zones. Now when zone awareness is enabled, we wait for all ingester results from at least 2 zones to be received before returning the results. However, for results from the 3rd zone, we are still trying to merge them. This can be inefficient as the results from 3rd zone are basically duplicates.
Thus, this pr tries to only use results from 2 zones. By having less data to merge, improve the latency as well as memory usage.
Which issue(s) this PR fixes:
Fixes #
Checklist
CHANGELOG.mdupdated - the order of entries should be[CHANGE],[FEATURE],[ENHANCEMENT],[BUGFIX]