fix: remove backoff retry from coordinator metadata status operations#976
Draft
mattisonchao wants to merge 4 commits intomainfrom
Draft
fix: remove backoff retry from coordinator metadata status operations#976mattisonchao wants to merge 4 commits intomainfrom
mattisonchao wants to merge 4 commits intomainfrom
Conversation
The status resource was using backoff.NewExponentialBackOff() from the cenkalti library directly, which has a default MaxElapsedTime of 15 minutes and is not context-aware. This caused several issues: - Held mutex lock during entire retry loop (up to 15 minutes) - Not context-aware, so retries couldn't be cancelled on shutdown - Errors silently discarded when retries exhausted - Inconsistent with the rest of the codebase which uses oxiatime.NewBackOff(ctx) The callers (shard controllers, elections, periodic tasks) already have their own retry mechanisms, making the status resource retry redundant. This change removes the backoff retry, returns errors to callers, and lets them handle failures appropriately. Signed-off-by: mattisonchao <mattisonchao@gmail.com>
- Check error returns from StatusResource methods in tests - Simplify redundant if-return pattern in split_controller.go Signed-off-by: mattisonchao <mattisonchao@gmail.com>
218ed9d to
d837be6
Compare
Make ConfigChanged return an error so callers can handle swap failures instead of looping forever when the metadata store is unavailable.
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.
Motivation
The coordinator status resource was using
backoff.NewExponentialBackOff()directly from the cenkalti library, which has a defaultMaxElapsedTimeof 15 minutes and is not context-aware. This held the mutex lock during the entire retry loop, couldn't be cancelled on shutdown, and silently discarded errors when retries exhausted. The callers already have their own retry mechanisms, making the status resource retry redundant and harmful.Modification
StatusResourcemethods (Swap,Update,UpdateShardMetadata,DeleteShardMetadata,loadWithInitSlow)StatusResourceinterface methods to returnerrorso callers can handle failures appropriatelyStatusResourcein balancer test to match new interface