Repository navigation
Fix flaky resource_queue_terminate, gp_relsizes_stats, ic and memoize tests - #2234
Open
chenjinbao1989 wants to merge 5 commits into
Open
chenjinbao1989 wants to merge 5 commits into
chenjinbao1989 wants to merge 5 commits into
Conversation
chenjinbao1989
force-pushed
the
test_flaky2
branch
from
November 3, 2026 21:18
346d2d3 to
0d36af0
Compare
fairyfar
self-requested a review
November 4, 2026 08:01
Collaborator
|
LGTM |
fairyfar
approved these changes
Nov 4, 2026
chenjinbao1989
force-pushed
the
test_flaky2
branch
from
November 5, 2026 15:43
94538b8 to
d63f814
Compare
lss602726449
approved these changes
Nov 6, 2026
| WHERE query='DECLARE cs2 CURSOR WITH HOLD FOR SELECT 0;'; | ||
|
|
||
| 2<: | ||
| -- The terminated backend releases its queue slot during process exit, which |
Contributor
There was a problem hiding this comment.
It seems that this case still failed
… tests resource_queue_terminate (isolation2): * pg_terminate_backend() only signals the target backend, and the queue slot held by the terminated session is released later during process exit (for holdable cursors in ProcKill() via AtExitCleanup_ResPortals()). The sanity check in scenarios 1 and 2 could therefore run before the cleanup and see rsqcountvalue = 1. Waiting for the pid to leave pg_stat_activity is not enough, since RemoveProcFromArray() runs before ProcKill(). Poll pg_resqueue_status until the queue count drops to 0 before the sanity checks instead. gp_relsizes_stats: * The test verifies that relsizes_collect_stats_once() scans files without the per-file naptime by checking that it finishes within 5 seconds. The paused scan of the 10k partition files takes at least 10s, but the unpaused run also includes worker startup, populating segment_file_sizes and updating the size history, which can exceed 5s on slow CI hosts. LOCALTIMESTAMP(0) also rounds to whole seconds. Use clock_timestamp() and raise the threshold to 8s, which still stays below the 10s floor of the paused scan. ic (regress and pax): * The QE error detection case injects one-shot exec_mpp_query_start faults on all segments without a session filter. Autovacuum is still enabled at this point of the schedule, and auto-analyze on the coordinator dispatches gp_acquire_sample_rows() to the segments, which can consume the faults first, so the test query occasionally hit no fault at all. Limit the faults to the current session. memoize: * For the expr_key join, ORCA chooses between Index Scan and Index Only Scan based on relallvisible. The VACUUM ANALYZE before the query can only mark the pages all-visible when no concurrent transaction from another test in the parallel group holds back the xmin horizon, so the plan flipped between runs. Disable optimizer_enable_indexonlyscan for this query. The planner uses Seq Scans here and is not affected.
The test checked only once that the mirror of content 0 was in sync before stopping the primary. After the large insert into seg0 the mirror may still be catching up (mode 'n'). FTS does not promote a mirror that is not in sync, so content 0 was left without a primary and the rest of the test failed. Wait for content 0 to be synchronized before stopping the primary.
When verify_cpu_usage() fails, the diff only shows 'f'. The samples normally read 10.0-10.2 for a 10% cap, so a miss of the +/-3 tolerance means something went systematically wrong, not sampling noise. Emit a warning with the average, the expected range and the raw samples when the check fails, so the next failure shows which way it missed. The output of a passing run is unchanged.
Apply the fix that vacuum_progress_row got earlier to the mirror-down case of vacuum_progress_column. FTS releases the syncrep wait as soon as it has marked seg1's mirror down, but only bumps the FTS version at the end of the probe cycle. If the coordinator starts the post-cleanup phase before that, it sees the old version and reuses the old vacuum workers, so vacuum_worker_changed is never hit and the test waits ten minutes for it to trigger. Hold the coordinator at vacuum_rel_finished_one_relation after the compact phase, and release it only after a full FTS probe cycle. Also wait for the mirrors to be in sync first, since the worker only changes if the compact phase commit blocks on syncrep.
Since 0b2d681 the mirror-down case reliably gets a new vacuum worker for the post-cleanup phase. That worker starts from fresh progress counters, so num_dead_tuples from the compact phase is still zero as the test expects, but it now reports the work post-cleanup itself did: two index vacuums and the truncated segfile blocks. The old expected output had all zeros, which only matched when the phase did nothing. vacuum_progress_row was updated the same way.
chenjinbao1989
force-pushed
the
test_flaky2
branch
from
November 6, 2026 19:59
ca792e2 to
5e8e863
Compare
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.
resource_queue_terminate (isolation2):
gp_relsizes_stats:
ic (regress and pax):
memoize:
Fixes #ISSUE_Number
What does this PR do?
Type of Change
Breaking Changes
Test Plan
make installcheckmake -C src/test installcheck-cbdb-parallelImpact
Performance:
User-facing changes:
Dependencies:
Checklist
Additional Context
CI Skip Instructions