tests: scope failpoint lock counts to each test's own keys (fixes #525, mitigates #516)#551
tests: scope failpoint lock counts to each test's own keys (fixes #525, mitigates #516)#551eduralph wants to merge 1 commit into
Conversation
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
|
Warning Review limit reached
Next review available in: 31 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. 📝 WalkthroughWalkthroughFailpoint transaction tests now scope lock counting and polling to their generated keys. Cleanup scenarios also perform explicit cleanup where needed and verify key-specific committed or rolled-back results. ChangesFailpoint lock assertions
Estimated code review effort: 2 (Simple) | ~10 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
The txn_cleanup_* failpoint tests counted locks with a whole-keyspace scan (count_locks / wait_for_locks_count over `..`). Because txn_cleanup_locks_batch_size stubs cleanup via the before-cleanup-locks failpoint and leaves its locks in place — and those are async-commit locks, which resolve in the background and drain at an unpredictable rate — a later serial test's unbounded scan would catch the still-draining residue and over-count (flaky '575 vs 512' / '513 vs 512'; tikv#525). The same residue enlarges cleanup_locks' cross-region work and can push it past the CI timeout (tikv#516). Fix, test-only: - Add count_locks_of / wait_for_locks_count_of that count only the caller's own keys, making the assertions immune to residual locks from other tests. - Switch all txn_cleanup_* count assertions to the scoped variants. - Have txn_cleanup_locks_batch_size resolve its own locks before returning, so it no longer seeds residue for the next serial test. - Remove the now-unused whole-keyspace wrappers. Suite is stable across repeated runs locally; no client (src/) change. Signed-off-by: Eduard R. <eduard@ralphovi.net>
5cc7b3f to
dde652f
Compare
|
@pingyu - ping for review |
The
txn_cleanup_*failpoint tests count locks with a whole-keyspace scan (count_locks/wait_for_locks_countover..).txn_cleanup_locks_batch_sizestubs cleanup via thebefore-cleanup-locksfailpoint and leaves its locks in place — and since they're async-commit locks, they resolve in the background and drain at an unpredictable rate. A later serial test's unbounded scan then catches the still-draining residue and over-counts — the flaky575 vs 512/513 vs 512in #525.Fix (test-only)
count_locks_of/wait_for_locks_count_ofthat count only the caller's own keys, making the assertions immune to residual locks from other tests.txn_cleanup_*count assertions to the scoped variants.txn_cleanup_locks_batch_sizeresolve its own locks before returning, so it no longer seeds residue for the next serial test.No client (
src/) change.Fixes #525.
Scope note: this does not address #516 (the
txn_cleanup_2pc_locks600s timeout). An earlier revision of this description suggested it might, by removing residue that amplifiescleanup_locks— that reasoning was wrong:txn_cleanup_2pc_locksruns first in the serial suite (it is consistently reported as( 1/54 )), so no residue from the other cleanup tests can reach it. #516 is a separate, still-undiagnosed stall and is left untouched here.Testing
Ran the suite repeatedly against a local multi-region cluster (
MULTI_REGION=1, the aggressive-splitconfig/tikv.toml) — stable across 10+ runs at ~5s each; the previously-observed count drift does not recur.make checkclean.Summary by CodeRabbit