Repository navigation
Make worker-convergence TAP cases deterministic - #105
Open
matt-welch wants to merge 1 commit into
Open
matt-welch wants to merge 1 commit into
matt-welch wants to merge 1 commit into
Conversation
Two cases in 23_fiction_worker_convergence.pl sampled windows that nothing held open. On a loaded two-CPU machine case 3 failed in most runs and case 13 in some. - Case 3 polled for the zero grant a not-yet-live database gets. That grant lasts only until the new worker's own launcher kick, a few milliseconds, so the poller usually saw the stale grant left on the paused row or the final one. A new injection point holds the spawned worker just before it publishes its pid, and the case asserts that the published grant and the worker's registered slot count are both 0 while it is held. - The case 3 slot check reads search_slots_registered instead of counting search slots in pg_stat_activity. A slot parked before the worker publishes its pid fails its first owner check and exits at once, so the activity count reads 0 whether or not a slot was parked. - Case 13 sampled a crashed worker's orphaned search slots before their next owner poll, which can come at any point within 2 s of the launcher clearing the dead entry. A new injection point holds the launcher across the crash, so the orphans survive until the test releases it. The crash points are detached before the release, so the respawned worker no longer trips them a second time. Signed-off-by: Matt Welch <matt.welch@intel.com>
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
Two cases in
test/t/23_fiction_worker_convergence.plassert on short windows by polling, and both fail intermittently in CI on main since the search-slot change in #103. Case 3 is the TAP failure currently showing up on open PRs. This PR makes both cases deterministic by holding the system at the moment each one checks, using two new injection points. What each case asserts is unchanged.vamana-worker-before-publish-pidinVamanaWorkerServeholds the spawned worker just before it publishes its pid. The case then reads the grant and the worker'ssearch_slots_registered.search_slots_registeredinstead of counting search slots inpg_stat_activity. A slot parked before the worker publishes its pid fails its first owner check and exits right away, so the activity count reads 0 whether or not a slot was parked.workerPid. After that, an orphan can reach its next owner poll and exit before the test samples the survivors.vamana-launcher-before-reconcilein the launcher loop holds the launcher across the crash. The crash points are detached before the launcher is released, so the respawned worker doesn't trip them a second time.INJECTION_POINTcompiles to nothing on builds without injection points. On those builds the two case 3 assertions are skipped, as cases 12 and 13 already are.No product behavior changes.
Related Issues
Type of Change
Pre-Merge Checklist
Build
makecompletes without errors or warningsmake installcompletes successfullyTests
make installcheck) and TAP tests (test/t/) pass with no failurestest/sql/and/ortest/t/test/modules/: it builds and passes (make -C test/modules/<module> installcheck)Documentation
docs/updated if architecture or usage changedTesting Notes
All runs were on this branch, which is based on current main, with injection points enabled.
Build:
make WERROR=1andmake installare clean, with no warnings.Full suites:
ci/test_server.conf: 10/10.prove_installcheck-hwpasses (2 files, 55 tests), andinstallcheck-hwwithci/test_server.confpasses 2/2.Flake rate: I ran
23_fiction_worker_convergence.pl25 times under CPU contention: pinned to two CPUs withtaskset, plus a busy loop on each CPU.The new assertions can still fail: each was checked against an injected regression.
Other intermittent failures seen on main recently (
58_residency_rollback_reconcile.pl,73_primary_slot_catchup_scale.pl, and onevamana_databasesSQL failure) are not addressed here. 58 and 73 predate #103.