fix: Mitigate ingester race between Query & GetChunkIDs - #15178
Merged
Conversation
grobinson-grafana
approved these changes
Nov 28, 2024
| ) | ||
|
|
||
| var defaultQuorumConfig = ring.DoUntilQuorumConfig{ | ||
| // Nothing here |
Contributor
There was a problem hiding this comment.
I think redundant comment. If we do want a comment I would write something like this (finishing the sentence):
Suggested change
| // Nothing here | |
| // We use the usable, default value of `DoUntilQuorumConfig` as ... | |
| var defaultQuorumConfig = ring.DoUntilQuorumConfig{} |
|
|
||
| // forAllIngesters runs f, in parallel, for all ingesters | ||
| func (q *IngesterQuerier) forAllIngesters(ctx context.Context, f func(context.Context, logproto.QuerierClient) (interface{}, error)) ([]responseFromIngesters, error) { | ||
| // waitForAllResponses param can be used to require results from all ingesters in the replication set. If this is set to false, the call will return as soon as we have a quorum by zone. Only valid for partition-ingesters. |
Contributor
There was a problem hiding this comment.
I think we can improve this comment, let's discuss offline.
Contributor
Author
There was a problem hiding this comment.
As discussed offline, we will follow up with some better comments in another PR.
| // forGivenIngesterSets runs f, in parallel, for given ingester sets | ||
| func (q *IngesterQuerier) forGivenIngesterSets(ctx context.Context, replicationSet []ring.ReplicationSet, f func(context.Context, logproto.QuerierClient) (interface{}, error)) ([]responseFromIngesters, error) { | ||
| // Enable minimize requests so we initially query a single ingester per replication set, as each replication-set is one partition. | ||
| // waitForAllResponses param can be used to require results from all ingesters in all replication sets. If this is set to false, the call will return as soon as we have a quorum by zone. |
Contributor
There was a problem hiding this comment.
Same here. Let's see if we can improve this comment. If I was unfamiliar with how this works, I would be surprised because results from all ingesters in all replication sets contradicts quorum by zone which by definition is a majority, not all.
This was referenced Dec 23, 2024
This was referenced Feb 3, 2025
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 / why we need it:
Fixes a race condition between the Query and GetChunkIDs calls when using partition-ingesters.
The bug occurs when first Querying logs from an ingester that just flushed a chunk (returning 0 logs), followed by calling GetChunkIDs on an ingester that has not flushed a chunk (returning 0 chunk refs). The bug manifests by returning 0 results when some log lines do exist in other ingesters.
Special notes for your reviewer:
Checklist
CONTRIBUTING.mdguide (required)featPRs are unlikely to be accepted unless a case can be made for the feature actually being a bug fix to existing behavior.docs/sources/setup/upgrade/_index.mddeprecated-config.yamlanddeleted-config.yamlfiles respectively in thetools/deprecated-config-checkerdirectory. Example PR