Repository navigation
Keep the quorum INSERT of 04405_mergetree_compact_cancel_after_finish single-stream - #122992
Conversation
… single-stream Since ClickHouse#109006 made `max_insert_threads` default to the number of cores, the test's `INSERT ... SELECT` writes through several `ReplicatedMergeTreeSink`s; the test was written when it had one. The sink that receives the rows commits `all_0_0_0`, which creates the non-parallel quorum node, and raises the expected `UNKNOWN_STATUS_OF_INSERT` at the `replicated_merge_tree_insert_quorum_fail_0` failpoint. A sink without rows whose `onStart` runs later then finds that node in `checkQuorumPrecondition` and raises `UNSATISFIED_QUORUM_FOR_PREVIOUS_WRITE`, which reaches the client first. Pin `max_insert_threads = 1` on that INSERT, as 04912 and 05211 already do. A single sink runs `onStart` before its own commit, so the second error cannot happen. The exact error assertion and the cancel-after-finish path the test covers are unchanged. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Internal second-model review: adjudication log (click to expand)Pre-publication review by an independent model (engine: codex; 1 finding).
Severity: ❌ blocker / Session id: cron:clickhouse-review-slot-8:20260930-000800 |
|
Workflow [PR], commit [4e1b7e0] Summary: ✅ AI ReviewSummaryThis PR stabilizes Missing context / blind spots
Final Verdict✅ No inline findings. |
Related: #122913
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
...
Description
04405_mergetree_compact_cancel_after_finishexpects its quorumINSERTto fail withUNKNOWN_STATUS_OF_INSERT(319) from thereplicated_merge_tree_insert_quorum_fail_0failpoint, and sometimes getsUNSATISFIED_QUORUM_FOR_PREVIOUS_WRITE(286) instead: 5 failures on 5 unrelated PRs in 60 days, none on master, e.g.Stateless tests (amd_asan_ubsan, flaky check)on #122913 andFast teston #120080.Root cause. Since #109006 made
max_insert_threadsdefault to the number of cores, thisINSERT ... SELECTwrites through severalReplicatedMergeTreeSinks; the test was written when it had one. The sink that receives the rows commitsall_0_0_0, which creates the non-parallel quorum node, and raises the expected 319 at the failpoint. A sink without rows whoseonStartruns later finds that node incheckQuorumPreconditionand raises 286, which reaches the client first. The flaky check's server log shows both: 319 raised by the sink that wrote the part, 286 returned to the client.Fix. Pin
max_insert_threads = 1on thatINSERT, as04912_pr_classic_pinned_block_numbersand05211_prewhere_column_sizes_pinned_block_numbersdo. A single sink runs itsonStartbefore its own commit, so the 286 cannot happen, and the exact 319 assertion stays. Keeping a non-parallel quorumINSERT ... SELECTsingle-stream in the engine is part of #113045.Validation (master build):
EXPLAIN PIPELINE: 4, 2 and 2 before (max_insert_threads4, the Requireno-parallelandno-fasttestfor tests that use failpoints #122913 draw, server default), 1 after in all three. The executedINSERTcreates 2 sinks before and 1 after.no-parallelandno-fasttestfor tests that use failpoints #122913 draw).MergeTreeDataPartWriterCompact::cancelreverted, the fixed test still crashes the server in that function.🤖 Generated with Claude Code
Workflow [PR]
Sync PR [sync-upstream/pr/122992]
Version info
26.10.1.1046-master(included in26.10and later)