fix(distributor): UserStats returns error when a ring member is LEAVING#7705
Open
Goutham-Annem wants to merge 1 commit into
Open
fix(distributor): UserStats returns error when a ring member is LEAVING#7705Goutham-Annem wants to merge 1 commit into
Goutham-Annem wants to merge 1 commit into
Conversation
…AVING UserStats queried all ingesters via GetIngestersForMetadata then forced MaxErrors = 0, requiring every ingester to respond successfully. When any ingester was in the LEAVING state (normal during a rolling update) and its RPC failed, UserStats returned an error to the caller. Remove the MaxErrors = 0 override so the ring's own quorum tolerance (RF/2 failures allowed for a Read operation) applies. Partial stats are better than a hard failure on the /api/v1/user_stats page. Closes cortexproject#4936 Signed-off-by: Goutham Annem <gouthemannem@gmail.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.
Fixes #4936
Proposed Changes
UserStatscalledGetIngestersForMetadata(which usesring.Read, includingLEAVINGinstances) and then explicitly setreplicationSet.MaxErrors = 0, requiring every ingester in the set to respond. During a rolling update or any graceful shutdown, ingesters transition through theLEAVINGstate and may return RPC errors. WithMaxErrors = 0, a single such failure caused the entire/api/v1/user_statsendpoint to return an error.The fix removes the
MaxErrors = 0override and lets the ring's own quorum tolerance apply (RF/2failures are allowed forReadoperations). This matches the behaviour of other metadata endpoints (e.g.LabelValuesForLabelName) that do not overrideMaxErrors.replicationSet.MaxErrors = 0inUserStats; add explanatory commentUserStatsmethod tomockIngesterTestUserStats_ToleratesLeavingIngesterthat confirms the endpoint succeeds with one unhappy ingester out of threeRelease Note