Skip to content

Shrink test 03100_lwu_57_lock_acquire_timeout - #125004

Merged
alexey-milovidov merged 5 commits into
masterfrom
remove-test-lwu-57-lock-acquire-timeout
Oct 11, 2026
Merged

alexey-milovidov merged 5 commits into
masterfrom
remove-test-lwu-57-lock-acquire-timeout

Conversation

@alexey-milovidov

@alexey-milovidov alexey-milovidov commented Oct 9, 2026 •

Copy link
Copy Markdown
Member

Shrink 03100_lwu_57_lock_acquire_timeout. It checks that lock_acquire_timeout and cancellation bound the wait for the lightweight update lock. It used server-global failpoints and deliberate lock holds, and was 605 lines long.

It took about 117 s (median) in Stateless tests (arm_asan_ubsan, azure, sequential), making it the third slowest test in that job. The job has started hitting its 9000 s timeout on master (7 of 22 runs on 2026-10-09).

The reduced test keeps one cheap arm per wait path:

  • the 1 s lock_acquire_timeout arm in Keeper sync and auto modes;
  • the single-chunk cancellation arm (lock_acquire_timeout = 2.5, max_execution_time = 2) in both Keeper modes and in both modes of a plain MergeTree;
  • a multi-chunk cancellation arm (lock_acquire_timeout = 20, max_execution_time = 2), interrupted between chunks of waitInterruptibly;
  • the multi-chunk watch arm (one watch registration across three chunks of waitInterruptibly);
  • the ZBADVERSION backoff via patch_parts_lock_pause_before_cas / PatchesAcquireLockBadVersionRetries.

It drops the long-hold, huge-timeout, zero-timeout and churn arms, and the per-mode multi-chunk cancellation arms. The test now runs in about 31 s in a release build and is no longer tagged long.

Related: #125003

Changelog category (leave one):

  • Not for changelog (changelog entry is not required)

🤖 Generated with Claude Code


Workflow [PR]
Sync PR [sync-upstream/pr/125004]

Version info

  • Merged into: 26.10.1.2134-master (included in 26.10 and later)

The test checks that `lock_acquire_timeout` bounds the wait for the
lightweight update lock in Keeper, across several modes, using
server-global failpoints and deliberate lock holds. This is a narrow
setting check, but it is the third slowest test (about 117 seconds) in
`Stateless tests (arm_asan_ubsan, azure, sequential)`, and that job
has started hitting its timeout.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@clickhouse-gh

clickhouse-gh Bot commented Oct 9, 2026 •

Copy link
Copy Markdown
Contributor

Workflow [PR], commit [9bb9523]

Summary: ✅


AI Review

Summary

This PR shrinks tests/queries/0_stateless/03100_lwu_57_lock_acquire_timeout.sh by dropping the slow long-hold matrix while keeping targeted coverage for the live PatchPartsLock behaviors: finite timeout in Keeper sync and auto, single-chunk cancellation in Keeper and plain MergeTree, cancellation between waitInterruptibly chunks, one-watch registration on the conflicting child, and the ZBADVERSION backoff path. I did not find a remaining correctness or coverage gap in the current version after checking the updated test against the prior review threads and the underlying PatchPartsLock wait logic.

Final Verdict
  • Status: ✅ Approve

@clickhouse-gh clickhouse-gh Bot added the pr-not-for-changelog This PR should not be mentioned in the changelog label Oct 9, 2026
@clickhouse-gh clickhouse-gh Bot added the comp-testing Test content only (no production code). label Oct 9, 2026
@alexey-milovidov alexey-milovidov added the blocker This issue / pr blocks a new release label Oct 9, 2026
…stead of removing it

Restore the test with only the cheap arms that still cover the replicated
lightweight update lock: the 1 s `lock_acquire_timeout` arm and the
cancellation-in-wait arm in 'auto' mode, and the `ZBADVERSION` retry via
`patch_parts_lock_pause_before_cas`. The `sync` and plain-`MergeTree` matrix,
the long-hold and churn/watch arms are dropped. It runs in about 7 s in a
release build and is no longer tagged `long`.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@alexey-milovidov alexey-milovidov changed the title Remove test 03100_lwu_57_lock_acquire_timeout Shrink test 03100_lwu_57_lock_acquire_timeout Oct 10, 2026
@alexey-milovidov

Copy link
Copy Markdown
Member Author

🕵 The 05238_pretty_squash_broken_pipe failure in Stateless tests (amd_debug, parallel) (clickhouse-local aborted with exit code 134) is unrelated to this PR. A fix is in progress in #125028.

@alexey-milovidov

Copy link
Copy Markdown
Member Author

🕵 The only failure in the last run is the job-level timeout of Stateless tests (arm_asan_ubsan, azure, sequential) (9050 s, no individual test failed: https://s3.amazonaws.com/clickhouse-test-reports/praktika.html?PR=125004&sha=d133f4fb044b46f2b7626a3375b99826b071cd24&name_0=PR&name_1=Stateless%20tests%20%28arm_asan_ubsan%2C%20azure%2C%20sequential%29). That job also times out on master. This PR is one of the changes that shorten it, and splitting the job is in progress in #123849. I merged master to pull in the other test reductions, including #125003.

…k_acquire_timeout`

Restore the cheap arms that cover the lightweight update lock paths the reduced test had dropped:
- the 1 s `lock_acquire_timeout` arm also in Keeper `sync` mode (`getLockForSyncMode`);
- the single-chunk cancellation arm (`lock_acquire_timeout = 2.5`, `max_execution_time = 2`) in
  both Keeper modes and in both modes of a plain `MergeTree`
  (`PlainLightweightUpdatesSync::lockSyncMutex` / `lockColumns`), which catches cancellation
  arriving in the final chunk of `waitInterruptibly` and replaces the multi-chunk cancellation arm;
- the multi-chunk watch arm, with a hold of exactly three chunks, which checks that the watch on
  the conflicting update's node is registered once rather than per chunk.

The long-hold, huge-timeout, zero-timeout and churn arms stay removed. The test takes about 28 s
in a release build instead of about a minute originally.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…57_lock_acquire_timeout`

The single-chunk arms only exercise the `checkTimeLimit` after the loop in
`waitInterruptibly`. A waiter with `max_execution_time = 2` and
`lock_acquire_timeout = 20` is interrupted by the check at the top of the second
iteration, about 3 s in; without that check it would wait out the 20 s lock timeout.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@alexey-milovidov
alexey-milovidov added this pull request to the merge queue Oct 11, 2026
@alexey-milovidov alexey-milovidov self-assigned this Oct 11, 2026
Merged via the queue into master with commit 81322cc Oct 11, 2026
165 checks passed
@alexey-milovidov
alexey-milovidov deleted the remove-test-lwu-57-lock-acquire-timeout branch October 11, 2026 18:51
@robot-ch-test-poll robot-ch-test-poll added the pr-synced-to-cloud The PR is synced to the cloud repo label Oct 11, 2026
@clickhouse-gh clickhouse-gh Bot added comp-mutations ALTER UPDATE/DELETE and mutation execution over parts (including lightweight updates/deletes). and removed comp-testing Test content only (no production code). labels Nov 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

blocker This issue / pr blocks a new release comp-mutations ALTER UPDATE/DELETE and mutation execution over parts (including lightweight updates/deletes). pr-not-for-changelog This PR should not be mentioned in the changelog pr-synced-to-cloud The PR is synced to the cloud repo

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants