Repository navigation
Crash recovery test: count the source by sorting; report a failed count - #92
Merged
Merged
Conversation
"a refresh after terminate" failed in CI run 40406996012 (PG 16, preload) with "the source has []": the refresh was fine, but the test's own oracle query, a parallel DISTINCT over the 2M unanalysed edge rows, ran into the session's 120 s statement_timeout (57014), and the check compared against the failed outcome's empty rows. The slow query is Postgres's, not pg_warren's: now and then the final HashAggregate above Gather spills into some 10^5 batches (EXPLAIN ANALYZE: Batches 172393, 140-170 s for 200000 groups). It reproduces in a cluster without pg_warren on PG 16 (1 in 60 runs) and PG 18 (6 in 60; 21 in 80 under load). With enable_hashagg off the same count sorts and took at most 0.4 s in 100 runs. The source is now counted with hash aggregation off, and a failed count is reported with its SQLSTATE and message instead of as an empty source. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012Rxfe2L3iVjSwSBPdUu1Ke
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.
This fixes the crash-recovery test, which failed on #90 (a docs-only PR) in CI run 40406996012. It reported
FAIL a refresh after terminate, withthe source has []. The refresh itself had worked.Cause: the test checks the result by counting the source's distinct edges,
SELECT DISTINCT src, dst FROM public.edgesover 2M rows. That count sometimes ran for minutes inside Postgres and hit the 120 s statement timeout. The test read the failed query as an empty source.enable_hashagg = off: none in 100, the longest 0.4 s.Changes:
count_sourceturns off hash aggregation for the count, so Postgres sorts instead. The check is unchanged.Runs:
Generated by Claude Code