Repository navigation
Isolate the mutation in 03100_lwu_01_basics from merges/mutations pool contention - #118435
Merged
alexey-milovidov merged 1 commit intoSep 6, 2026
Merged
Conversation
…ool contention The test timed out in `ALTER TABLE t_shared APPLY PATCHES SETTINGS mutations_sync = 2`: the merge-selecting task refused to assign the mutation because the server-global pool was occupied by concurrent tests (`max_tasks_count (32) - occupied (25) < number_of_free_entries_in_pool_to_execute_mutation (8)`), and since the table had just been re-attached, `merge_selecting_sleep_ms` started near `max_merge_selecting_sleep_ms`, so the next attempt was scheduled only after 60000 ms and the `mutations_sync = 2` wait hit its 60 s limit. Set `number_of_free_entries_in_pool_to_execute_mutation = 0` on the table, as `02899_restore_parts_replicated_merge_tree` already does for the same reason. CI report: https://s3.amazonaws.com/clickhouse-test-reports/praktika.html?PR=116885&sha=76f996abfd704d65e2eeb35a9cc4de47ac9cf0ba&name_0=PR&name_1=Fast%20test PR: #116885 Co-Authored-By: Claude Fable 5.1 <[email protected]>
Contributor
|
Workflow [PR], commit [9312d28] Summary: ✅ AI ReviewSummaryThis PR stabilizes Final Verdict✅ No blocking findings. |
alexey-milovidov
deleted the
fix/03100-lwu-basics-mutation-pool-contention
branch
September 6, 2026 20:39
github-merge-queue Bot
pushed a commit
that referenced
this pull request
Sep 15, 2026
… merges/mutations pool contention 04068_lwd_minmax_projection_recovery_rmt stops making progress and is killed by the Fast test 60 second per-test cap: 3 failures in 190,994 runs over 45 days, none of them on master, and in the job that surfaced it (#120099) it was the sole red of 15,103 rows. It is a stall rather than a slow test (the OK maximum is 7.0 s over 25,331 Fast test runs and 14.5 s over 10,219 arm_darwin runs, while the failures sit at 60.05 and 60.10 s), and the non-replicated sibling of this test has 0 failures in 190,985 runs. The twelve single-row INSERTs each schedule the merge-selecting task, so twelve iterations run back to back, find nothing mergeable and return AttemptStatus::CannotSelect, which multiplies merge_selecting_sleep_ms up to max_merge_selecting_sleep_ms (60 s). DELETE FROM then creates the mutation, and the single iteration that sees it is refused by the pool-headroom guard in CompactionStatistics::getMaxSourcePartBytesForMutation: max_tasks_count (32) - occupied (25) < number_of_free_entries_in_pool_to_execute_mutation (8) so max_source_part_bytes_for_mutation is 0 and mergeSelectingTask returns AttemptStatus::Limited. Limited matches neither arm of the backoff epilogue, so the saturated 60 second interval is reused verbatim, no MUTATE_PART entry is created, and lightweight_deletes_sync = 2 blocks until max_execution_time fires. With the threshold at 0 the guard's comparison is unconditionally true for this table, so the mutation is assigned on the first iteration that sees it, whatever unrelated parallel tests are doing to the server-global pool. The non-replicated sibling is immune because StorageMergeTree::mutate() calls background_operations_assignee.trigger(), which shrinks its backoff instead of leaving it saturated. Reproduced as a 2x2 over pool occupancy and this diff, on one server and one binary: the pristine file with an occupied pool fails with code 159 after 60.64 s; this diff under the same occupancy passes in 2.69 s with byte-for-byte reference output; both files pass on an idle pool, which places the failure on occupancy rather than on the test. 100 of 100 randomized runs of this test and its plain sibling pass, as do 10 runs each of 02440_mutations_finalization and 03716_mutations_parts_postpone_reasons_rmt. The engine-level starvation, where Limited reuses a saturated interval for every Replicated table, is tracked upstream in #61902 and is deliberately not touched here; this is the same test-side remedy already merged in #118435 and #112090 for the identical log signature. Related: #120099 Co-Authored-By: Claude Opus 5 <[email protected]>
This was referenced Oct 7, 2026
eliangidoni
pushed a commit
to eliangidoni/ClickHouse
that referenced
this pull request
Oct 7, 2026
…ontention `04612_mutation_pruning_exotic_predicates` was killed by the Fast test 60 s cap in `Fast test (arm_darwin)` on ClickHouse#117272 and ClickHouse#115724. Each merge-selecting run that finds nothing to do multiplies the table's poll interval, and the test's back-to-back replicated mutations push it to `max_merge_selecting_sleep_ms` (60 s) within a second. When concurrent tests occupy the server-wide merges/mutations pool, the run that sees the next mutation is refused by the `number_of_free_entries_in_pool_to_execute_mutation` guard, returns `Limited` and keeps the saturated interval, so no MUTATE_PART is created for 60 s and `mutations_sync = 2` waits past the cap. The same stall shows up on Linux, where the 600 s stateless timeout hides it, and in `04696_mutation_pruning_subcolumn_predicates` (41.6 s in an amd_debug run). Setting the threshold to 0 on the two replicated tables makes the guard always pass for them, as in ClickHouse#118435. The queries and references are unchanged. The engine-level starvation is ClickHouse#61902. Co-Authored-By: Claude Opus 5.5 <[email protected]>
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.
03100_lwu_01_basicstimed out inALTER TABLE t_shared APPLY PATCHES SETTINGS mutations_sync = 2in the Fast test of #116885 (report: https://s3.amazonaws.com/clickhouse-test-reports/praktika.html?PR=116885&sha=76f996abfd704d65e2eeb35a9cc4de47ac9cf0ba&name_0=PR&name_1=Fast%20test).The server log shows the merge-selecting task refusing to assign the mutation because the server-global merges/mutations pool was occupied by concurrent tests:
The table had just been re-attached by the test (
DETACH TABLE/ATTACH TABLE), and on attachmerge_selecting_sleep_msis initialised nearmax_merge_selecting_sleep_mswhen the partition has few parts, so the next attempt came only after 60 s and themutations_sync = 2wait hit its 60 s limit (Failed to wait for mutation '0000000000', will recheckrepeated untilTIMEOUT_EXCEEDED).Set
number_of_free_entries_in_pool_to_execute_mutation = 0on the table so its mutation does not depend on the pool occupancy of unrelated tests, as02899_restore_parts_replicated_merge_treealready does for the same reason (#112090). The test's output does not depend on this setting.Related: #116885
Related: #112090
Changelog category (leave one):
🤖 Generated with Claude Code
Workflow [PR]
Sync PR [sync-upstream/pr/118435]