Harden recovery from metastore overload#6592
Closed
fmassot wants to merge 2 commits into
Closed
Conversation
This was referenced Jul 12, 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.
Description
A production metastore overload exposed several recovery paths that could keep a cluster degraded long after the initial database pressure had subsided.
See Metastore overload and cluster recovery for the trigger, the fix-by-fix outage mechanics, regression coverage, and remaining limitations.
This change hardens recovery across the control plane, indexing scheduler, ingest router, and metastore server:
TooManyRequestserrors instead of respawning the control plane.NoShardsAvailableresponses.max_connections - 1unary RPCs when possible so readiness and control work retain connection-pool headroom during lock convoys.The PostgreSQL admission limit is intentionally best-effort rather than a hard reservation: streaming responses and direct pool users do not hold this generic RPC permit for their entire database lifetime. SQLx pool-acquisition timeouts remain conservatively classified as uncertain database errors.
How was this PR tested?
cargo test -p quickwit-common --lib(132 passed)cargo test -p quickwit-ingest --lib -- --skip test_ingester_persist_replicate_grpc(174 passed, 1 ignored)cargo test -p quickwit-control-plane --lib(128 passed)SSL_CERT_FILE=/etc/ssl/cert.pem cargo test -p quickwit-serve --lib(165 passed)cargo clippy -p quickwit-common -p quickwit-ingest -p quickwit-control-plane -p quickwit-serve --lib --tests -- -D warningsrustfmt --checkon all eight changed Rust filesRegression coverage includes generation-owned task cancellation, readiness transitions, stale callback rejection, recoverable overload handling, generation-aware plan replay, source-scoped routing recovery, closed-shard feedback sent exactly once across grouped requests, and shared cross-method metastore admission with permit release after cancellation.