Repository navigation
Docs: explain what SYSTEM STOP MERGES does not cover - #126337
Conversation
The SYSTEM STOP MERGES section only said that DETACH/ATTACH restarts merges. Measured on 26.8.7.19 (single server, plain MergeTree): - OPTIMIZE TABLE (with or without FINAL) on a table with stopped merges fails with "Cancelled merging parts. (ABORTED)" (StorageMergeTree::merge checks merges_blocker before selecting parts). - SYSTEM STOP MERGES without a table name only adds action locks for the tables that exist at that moment (startStopActionInDatabase iterates the existing tables), so tables created later still merge (ClickHouse#91183). - SYSTEM STOP MERGES with the name of a table that does not exist yet returns Ok and has no effect on the table created later. - The action locks live in memory, so a server restart starts merges again. The text is the documentation registration in ParserSystemQuery.cpp; the generated system.mdx region is left to the docs workflow. Signed-off-by: YoungjuKim <[email protected]>
|
Workflow [PR], commit [828d126] Summary: ✅
AI ReviewSummaryThe PR documents the scope and lifetime of Final VerdictStatus: ✅ Approve |
Build profile diff (arm_release)Comparing ✅ No significant changes. Binary sizes
The official master build is compiled with Compile time of recompiled translation units8 translation units recompiled, 9 s compile time in total, 8 of them have a recent master baseline. |
alexey-milovidov
left a comment
There was a problem hiding this comment.
All good. Thank you!
Related: #91183
Changelog category (leave one):
What and why
The
SYSTEM STOP MERGESsection only says thatDETACH / ATTACHrestarts merges. Four other behaviours surprised us while writing a training lab, so this PR documents them in the documentation registration (src/Parsers/ParserSystemQuery.cpp). The generated region ofdocs/reference/statements/system.mdxis not edited by hand, followingdocs/reference/AGENTS.md.OPTIMIZE TABLE(with or withoutFINAL) on a plain MergeTree table with stopped merges fails withCancelled merging parts. (ABORTED). Source:StorageMergeTree::mergechecksmerges_blocker.isCancelledForPartition()before selecting parts.SYSTEM STOP MERGESwithout a table name only locks the tables that exist at that moment.InterpreterSystemQuery::startStopActionInDatabaseiterates over the existing tables. Tables created later still merge, which is what SYSTEM STOP MERGES not applying to newly created tables #91183 reports.SYSTEM STOP MERGES db.tfor a table that does not exist yet returnsOk.and has no effect on a table created later under that name.startStopActionusestryGetTableand does nothing when the table is missing.ActionLocksManager, so merges run again after a server restart.The text about
OPTIMIZEonly claims non-replicated MergeTree. ReplicatedMergeTree takes a different path (log entry plus replication queue), and I did not test it.How it was checked
ClickHouse 26.8.7.19 (official build,
clickhouse-common-staticLTS tarball), single server in a Kubernetes pod, run on 2026-10-16 (UTC). Script excerpt and output:This change was drafted with AI assistance and reviewed by me.
🤖 Generated with Claude Code
Workflow [PR]
Sync PR [sync-upstream/pr/126337]
Version info
26.11.1.1020-master(included in26.11and later)