Distinguish metastore retry attempts from final errors - #6698
Merged
Conversation
Mallets
force-pushed
the
mallets/metastore-metrics
branch
from
August 17, 2026 16:48
9fad660 to
9d0eb17
Compare
Mallets
marked this pull request as ready for review
August 17, 2026 16:50
Document why request metrics must wrap retries to avoid counting retry attempts as final errors.
Document Tower's outermost-first stacking and why metrics must wrap retries.
Decouple gRPC retry metrics from Quickwit's concrete retry policy while preserving retry outcome coverage.
Align the metrics wrapper and tests with the proposed generic policy implementation.
guilload
approved these changes
Aug 18, 2026
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.
Summary
Tower gRPC request metrics are emitted when the request future is dropped. At that point, a failed attempt is recorded as
status="error", even if the retry policy will retry it. Consequently, transient failures appear as hard errors in metric queries.This PR introduces
GrpcRetryPolicy, a gRPC-aware wrapper around the generic retry policy. It observes retry decisions and identifies failed attempts that will be retried. These attempts are recorded withstatus="retry", while preserving the original gRPC status code in thecodelabel. Final failures continue to usestatus="error".The metastore client is updated to use this policy and to place the gRPC metrics layer outside the retry loop. As a result:
status="retry"status="error"is reserved for the final client-visible failure, including exhausted retriesstatus="success"represents the final successful outcome, including success after retriesScope
Metastore is the only service behaviorally impacted by this change because it is the only service that combines
GrpcMetricsLayerwith Quickwit'sRetryPolicy. Control plane, indexing, ingest, and cluster also useGrpcMetricsLayer, but they do not use it with this retry policy, so their metric semantics remain unchanged.The shared gRPC metastore metrics and retry status semantics are also documented.
Contributions
Integrates changes proposed in https://github.com/quickwit-oss/quickwit/compare/guilload/retry-metrics
Validation
cargo +nightly fmt --allcargo test -p quickwit-common test_grpc_metricscargo clippy -p quickwit-common --all-features --testscargo clippy -p quickwit-serve --all-features --tests