test(coverage): wire recd group into COV_RECD block for *_rec.c branch coverage - #87
Closed
gburd wants to merge 1 commit into
Closed
test(coverage): wire recd group into COV_RECD block for *_rec.c branch coverage#87gburd wants to merge 1 commit into
gburd wants to merge 1 commit into
Conversation
The per-operation recovery handlers (__xxx_recover: redo/undo/abort/ do-nothing branches) in db/db_rec.c (3189 br), hash/hash_rec.c (2069), btree/bt_rec.c (2366) and qam/qam_rec.c (574) were the biggest cold BRANCH surface. The subset ran only recd001/002/016 on btree, leaving the hash and queue handlers at 0% and most btree/db redo/undo branches cold. Add a COV_RECD block (default on) that drives the recd group driver-per-test (each in its own tclsh, per-test timeout, recdscript.tcl orphan cleanup) -- recd tests use conflicting globals (recd006 kvals scalar vs recd010 array) so they cannot share one interpreter. The set is curated for coverage-per-minute across every access method each test supports; whole block ~10 min, every test PASSes well inside a 300s timeout. Recd-driven branch % (measured, gcc --coverage, -O0): db/db_rec.c 14.6 -> 16.4 btree/bt_rec.c 12.3 -> 21.6 hash/hash_rec.c 0 -> 24.2 qam/qam_rec.c 0 -> 45.5 recd001/002/016 removed from COV_TESTS (superseded by the driver-per-test block; recd001 was 6.5 min and added ~1 branch over the rest). recd003/ 007/015 deliberately excluded: too slow under -O0 for the marginal branches they add (recd003 does not unlock the still-cold __bam_root/ irep/rcuradj or __db_ovref handlers). No recovery-correctness bug surfaced: all forward+backward replays verified clean.
Collaborator
Author
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.
What
Adds a
COV_RECDblock (default on) totest/coverage/run_coverage.shthatdrives the
recdrecovery-record test group driver-per-test, raisingBRANCH coverage of the four
*_rec.crecovery-handler files — the biggestremaining cold branch surface in the tree.
The
__xxx_recoverhandlers each have redo / undo / abort / do-nothingbranches.
op_recover(testutils.tcl) crashes the env at every log-recordboundary and replays recovery forward (redo) and backward (undo/abort) —
exactly the cold branches. The subset previously ran only
recd001/002/016on btree, so the hash and queue handlers were at 0% and most
btree/db redo/undo branches were cold.
Results (recd-driven branch %,
gcc --coverage,-O0)db/db_rec.cbtree/bt_rec.chash/hash_rec.cqam/qam_rec.cValidated end-to-end via
run_coverage.sh(COV_RECD=1, EXITCODE=0): all26 recd runs PASS, each well inside its 300s per-test timeout (slowest is
recd004 at ~84s). Whole block ~10 min.
The curated set (coverage-per-minute)
Driver-per-test (each in its own
tclsh— several recd tests use conflictingglobals, e.g.
recd006setskvalsas a scalar whilerecd010uses it as anarray, so they cannot share one interpreter; each also spawns
recdscript.tclsubprocesses that need orphan cleanup):
recd010 off-page-dup splits, recd014 queueext (the only thing that
reaches
__qam_delext_recover), recd016 checksum, recd017 crypto,recd018 checkpoint/commit, recd019 txn-id wrap, recd020 dirs,
recd022 aborted-prepared page-alloc, recd023 reverse split,
recd024 streaming partial-put overflow, recd025 TXN_BULK.
recd001/002/016removed fromCOV_TESTS(superseded by the driver-per-testblock, which is more robust than the shared-
tclshloop).Deliberately excluded (too slow for the marginal branches,
-O0)redo/undo branches — dropping it entirely moved the totals by ~1 branch.
__bam_root/irep/rcuradjor__db_ovrefhandlers (they need scenarios nobounded recd test reaches), so its 7 min buy only a few adjacent branches.
recd_compact + upgrade drivers already in the subset.
Recovery correctness
No bug surfaced — all forward+backward replays across every access method
verified clean (that is the good outcome; a redo/undo bug would have failed
op_recover's post-recovery verify).Follow-up (not in this PR)
Still-cold handlers that need scenarios no bounded recd test reaches:
__bam_root_recover,__bam_irep_recover,__bam_rcuradj_recover,__db_ovref_recover,__db_cksum_recover. These would need a targeted Crecovery driver (like the existing
recd_compactone) rather than a Tcl test.