-
Notifications
You must be signed in to change notification settings - Fork 86
Collapse verb narrows its slice adaptively instead of dying at the timeout #2132
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
+152
−18
Merged
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
a130b0f
Collapse verb narrows its slice adaptively instead of dying at the ti…
erikdarlingdata ce45eed
Retry on a fresh connection, and narrow in real terms — both review c…
erikdarlingdata 0eb0731
Guard the reopen, retry the below-floor tail once, and pin the narrow…
erikdarlingdata File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Retry reuses a connection that may already be dead.
On failure the loop
continues and callsCollapseSliceAsyncagain on the sameconnection(line 3037-3038). But the failure mode this PR exists to survive isSliceStatementTimeoutSeconds(900s) expiring — and per the doc comment on that constant a few lines up inQueryStoreSliceRepair.cs("The failure read as 'Exception while reading from stream' ... which is how an Npgsql command timeout surfaces"), that's a bare stream exception, not a clean57014 canceling statement due to user request. That's the signature of Npgsql's cancel-on-timeout failing to land and force-closing/breaking the connection rather than cleanly cancelling server-side.If the connection is actually broken at that point, the next iteration's
BeginTransactionAsyncfails immediately — not because the narrower window still doesn't fit, but because there's no usable connection. The loop would then burn through all six halving steps almost instantly on local connection errors and give up, without the narrower windows ever really being tried against Postgres — quietly defeating the fix in exactly the scenario (a real statement timeout) it's meant to handle.The PR description notes this exact retry path "can't be provoked deterministically in a live test," so it looks untested end-to-end. Worth checking
connection.FullState/Stateand reopening (or just opening a fresh connection per slice, likeQueryStoreBackfill.csdoes per-attempt) before retrying, and verifying against a real 900s timeout before shipping — this repo already treats "a dead connection poisons every collector" as a known failure class elsewhere (DarlingWorker.cs).