Repository navigation
Docs: document the missing SYSTEM statements - #131679
Conversation
Add sections to the SYSTEM reference page (documentation["SYSTEM"] in ParserSystemQuery.cpp) for the statements that parse but had no section: RELOAD DELTA KERNEL TRACING, RESTART DISK, CLEAR|DROP SCHEMA CACHE, FLUSH ASYNC INSERT QUEUE, RECONNECT ZOOKEEPER, RESET DDL WORKER, JEMALLOC PURGE / FLUSH PROFILE / ENABLE|DISABLE PROFILE, SCHEDULE MERGE, SYNC MERGES, STOP|START CLEANUP, STOP|START VIRTUAL PARTS UPDATE, STOP|START REDUCE BLOCKING PARTS, UNLOCK SNAPSHOT, WAIT QUERY RUNNER and SYNC TRANSACTION LOG, and their forms to the syntax summary. Each section has an "Introduced in" line (the first release whose ASTSystemQuery.h has the statement), the ExperimentalBadge where the statement needs an experimental setting, a Cloud-only note for the three statements that do nothing or fail in open-source builds, and the required privilege. Every behaviour sentence was observed on a server built from this branch. Related: ClickHouse#131085 Co-Authored-By: Claude Opus 5.5 <[email protected]>
- RESTART DISK was introduced in 21.6 (the first 21.6 release tag, v21.6.2.7-prestable, has it; v21.5.9.4-stable does not). - RESET DDL WORKER only requests the reset: the DDLWorker thread performs it later, the statement returns at once. - UNLOCK SNAPSHOT and JEMALLOC FLUSH PROFILE state their own privilege. - SCHEDULE MERGE: the parts must be adjacent parts of one partition, in order; a list that is not is never merged and holds back the merges scheduled after it (ManualMergeSelector selects only a contiguous run of one parts range and stops at the first entry it cannot select). Related: ClickHouse#131085 Co-Authored-By: Claude Opus 5.5 <[email protected]>
- FLUSH ASYNC INSERT QUEUE: with a table list the statement waits only for the batches it takes from the queue itself (AsynchronousInsertQueue::flush), while flushAll also waits for in-flight flushes and the pool; an insert whose data does not parse is dropped and logged to system.asynchronous_insert_log, and the statement still succeeds (observed). - SCHEDULE MERGE: TTL merges are chosen before the manual selector (MergeSelectorApplier::chooseMergesFrom), so they still run on a 'Manual' table (observed TTLDropMerge); a scheduled range must also pass the regular merge size constraints (checkPreparedRangeAgainstConstraints, observed with max_bytes_to_merge_at_max_space_in_pool = 1); the schedule lives in a process-local registry and is lost on restart (observed: SYNC MERGES returns at once after a restart, parts unmerged). - STOP|START CLEANUP: CloudNotSupportedBadge, StorageSharedMergeTree has no ActionLocks::Cleanup lock. - UNLOCK SNAPSHOT: the FROM destination is authorized against SOURCES grants (READ on S3/AZURE), like RESTORE. Related: ClickHouse#131085 Co-Authored-By: Claude Opus 5.5 <[email protected]>
- RESTART DISK: refreshDataPartsOnce only adds the parts that appeared since the last scan (it seeds parts absent from data_parts_by_info) and does not detect removed ones (observed: a part dropped by the writer stays in the read-only reader's system.parts after the statement). - SCHEDULE MERGE: the ManualMergeSelector registry is keyed by database, table and uuid and renameInMemory does not re-key it, so a table or database rename also loses the schedule (observed: SYNC MERGES returns at once after either rename, parts unmerged). - UNLOCK SNAPSHOT: a FROM destination given as a named collection is resolved through BackupInfo::getNamedCollection, which also checks NAMED COLLECTION. Related: ClickHouse#131085 Co-Authored-By: Claude Opus 5.5 <[email protected]>
- SCHEDULE MERGE: the ManualMergeSelector registry entry is keyed by database, table and uuid and is erased only when the table is dropped, so a rename does not lose the schedule: it is not performed under the new name and applies again once the table gets its old name back (observed for both a table and a database rename: no merge under the new name, the scheduled merge runs at once after the rename back). - STOP CLEANUP: getCleanupLock only cancels the blocker, which the cleanup thread checks before each iteration, so a running iteration finishes after the statement returns (observed with the storage_merge_tree_background_clear_old_parts_pause fail point: the grabbed parts were removed after STOP CLEANUP, later outdated parts stayed). Statements such as DROP PART remove outdated parts themselves, so only the background cleanup is described as stopped. Related: ClickHouse#131085 Co-Authored-By: Claude Opus 5.5 <[email protected]>
- JEMALLOC FLUSH PROFILE: InterpreterSystemQuery::execute hands any query with ON CLUSTER to executeDDLQueryOnCluster before building the filename pipeline, so each server writes its own profile file and the initiator returns the distributed DDL status, as selected by distributed_ddl_output_mode (observed: header host, port, status, error, num_hosts_remaining, num_hosts_active, no filename; nothing with `none`; the server still wrote its .heap file). - RELOAD DELTA KERNEL TRACING: without USE_PARQUET && USE_DELTA_KERNEL_RS the statement throws SUPPORT_IS_DISABLED "Delta Kernel support is not enabled", the same note the JEMALLOC sections carry for builds without jemalloc. Related: ClickHouse#131085 Co-Authored-By: Claude Opus 5.5 <[email protected]>
Internal second-model review (rounds 1-7)Bounce cap reached - published as-is; residual findings listed below (the two rows marked "not changed").
|
Pre-PR validation gate (click to expand)
Session id: cron:clickhouse-impl-slot-6:20261114-140304 |
|
Workflow [PR], commit [0f66dea] Summary: ❌
AI ReviewSummaryThe PR adds reference documentation for previously undocumented Findings
Missing context / blind spots
Final Verdict |
|
@groeneai as a separate fix - it should not be necessary to explicitly import badges inside the .cpp definition. We should handle these transparently so that the generator inserts them at the start of the inside of the autogenerated block. Open a PR with a fix for this and remove all explicit imports in the code where they exist. The components can still be used, e.g. |
|
Acknowledged. I'm working on making the docs generator insert the snippet-component imports itself at the start of the autogenerated block, and removing the explicit imports from the source registrations; I'll follow up here with the PR link. |
|
Opened #131704: the generator now inserts the import of every badge a generated region renders at the start of that region, and the 57 explicit badge imports are removed from the source registrations. It is stacked on #130905, so it should go in after #130905 and #130608. The one import this PR adds in |
CI finish ledger - 0f66deaEvery failure below has an owner: a fixing PR (mine or external), or a full-effort fix task
Session id: cron:our-pr-ci-monitor:20261114-233011 |
52d3d52
A Mintlify page must import every badge it renders. `replace_between_markers`
wrote the generated content verbatim, so the only place such an import could
come from was the documentation string itself: 57 `import { XBadge } ...`
lines in 44 descriptions, 12 of them for badges the page never renders, all
visible in `system.documentation`.
`replace_between_markers`, the placement point of every marker family and
of the statement pages, now prepends at the start of the region one
`import { XBadge } from "/snippets/components/XBadge/XBadge.jsx";` per
`*Badge` tag the new content renders that the resulting page does not import
yet. The old region is not consulted (it holds the previous generation's
imports); the text outside the region and the new content are, so function
category pages that import their badges above the region, and doc strings
that still carry an import, get no duplicate. Imports follow first use. The
split settings pages keep their own derivation.
Remove the badge imports (and the blank line after each group) from the doc
strings. Retarget 04415 (TimeSeries renders `<PrivatePreviewBadge/>` without
importing it) and 05023 (full-page detection past an MDX import: the polygon
layout's snippet import). The two dictionary page self-tests now compare
through `replace_between_markers`, so they model the inserted imports.
Full `--write` A/B (old script + old binary vs new script + new binary):
26,348 of 26,358 docs files byte-identical; 6 pages drop the 12 unused
imports, 3 pages reorder imports by first use, and
`beta-and-experimental-features.mdx` reorders rows, which also happens
between two runs of the old generator.
Related: ClickHouse#131679
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Related: #131085
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
Document the
SYSTEMstatements that had no section in the SQL reference:RELOAD DELTA KERNEL TRACING,RESTART DISK,CLEAR SCHEMA CACHE,FLUSH ASYNC INSERT QUEUE,RECONNECT ZOOKEEPER,RESET DDL WORKER, theJEMALLOCstatements,SCHEDULE MERGE,SYNC MERGES,STOP|START CLEANUP,STOP|START VIRTUAL PARTS UPDATE,STOP|START REDUCE BLOCKING PARTS,UNLOCK SNAPSHOT,WAIT QUERY RUNNERandSYNC TRANSACTION LOG.Description
Second of the PRs for the statements without reference documentation that @ Blargian asked for in #131085: the
SYSTEMstatements that parse on master but had no section on theSYSTEMpage.The sections are added to
documentation["SYSTEM"]inParserSystemQuery.cpp, which the docs autogeneration turns intodocs/reference/statements/system.mdx; the syntax summary insystem.statementsgets the new forms. Each section has anIntroduced inline (the first release whoseASTSystemQuery.hhas the statement, checked on the release tags), the experimental badge with the enabling setting named forSCHEDULE MERGE,SYNC MERGES,UNLOCK SNAPSHOTandSYNC TRANSACTION LOG, and the required privilege.VIRTUAL PARTS UPDATE,REDUCE BLOCKING PARTSandUNLOCK SNAPSHOTare marked as available only in ClickHouse Cloud, with what they do in other builds, andSTOP|START CLEANUPas not supported in Cloud; their Cloud behaviour comes from in-tree text (setting descriptions, the snapshot page, test comments), so please correct it if it is wrong. Not documented:SYSTEM DROP AMBER NODEand the threeAMBER VOLUMEstatements (new on master, they fail withUnknown type of SYSTEM queryin open-source builds).Validation: I ran every behaviour the sections describe that an open-source server can execute on a server built from this branch, and the examples are copied from those runs; the rest is read from the source. I regenerated the page with
autogenerate_docs.py --write --only 'statement:';lychee_check.py --mode linksreports 0 errors, and a corrupted anchor is reported.check_autogenerated_regions.pypasses; the PR contains no generated text.🤖 Generated with Claude Code
Workflow [PR]
Sync PR [sync-upstream/pr/131679]
Version info
26.11.1.2331-master(included in26.11and later)