Repository navigation
Conversation
`BACKUP` and `RESTORE` were documented only in the backup and restore guides, and `ALTER TABLE ... UNLOCK SNAPSHOT` only in the snapshot backup guide, although the parsers accept all of them. `ParserBackupQuery` gets documentation entries for `BACKUP` and `RESTORE` and is registered, and the `ALTER` documentation gains an `ALTER TABLE ... UNLOCK SNAPSHOT` entry and a row in the `ALTER` overview, so `system.statements` exposes them and the docs autogeneration fills the new `backup.mdx`, `restore.mdx` and `alter/unlock-snapshot.mdx` pages. The pages cover the full grammar: elements, destinations, archives, `ON CLUSTER`, `ASYNC`, the result, every BACKUP and RESTORE specific setting with its default (taken from `system.backups.settings`), the privileges, and `BACKUP FROM SNAPSHOT`. Each page and section states the version it was introduced in, measured on the release tags through the GitHub API. `BACKUP FROM SNAPSHOT`, `ALTER TABLE ... UNLOCK SNAPSHOT` and the `experimental_lightweight_snapshot` setting are marked experimental and ClickHouse Cloud only; `BACKUP` and `RESTORE` themselves are not behind any setting. Every behaviour on the pages was observed on a server built from this branch, and the examples are copied from those runs. The generated regions are left to the autogeneration workflow. Related: ClickHouse#131085 Co-Authored-By: Claude Opus 5.5 <[email protected]>
The five-argument form takes a storage account URL, not a connection string (`registerBackupEngineAzureBlobStorage.cpp`). Co-Authored-By: Claude Opus 5.5 <[email protected]>
…or limits The pages now state that ZIP archives are also refused on a `Disk` backed by S3 or Azure object storage and that no archive can be used with `ON CLUSTER`; that temporary tables need no `BACKUP` privilege, that a base backup needs the `READ` source privilege (for `RESTORE` also the base the backup records) and that a named collection destination needs `NAMED COLLECTION`; the `extra_credentials` argument of `S3` and the `key = value` overrides of a named collection locator; that `compression_level` is not supported for TAR archives; how the server settings `backups.data_file_name_generator` and `backups.data_file_name_prefix_length` change the defaults; the ClickHouse Cloud settings `resumable_backup_batch_size` and `resumable_backup_batch_size_bytes`; and that `RESTORE ... ALL` exists since v22.7. The first example creates its database, and the asynchronous example says the `system.backups` query runs after the backup finished. Each new sentence was observed on a server built from this branch. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…ege limits `ON CLUSTER` legs run outside the current session, so the pages now say that `Memory` destinations and session temporary tables cannot be used with it and that `ALL` leaves those temporary tables out. The `experimental_lightweight_snapshot` row says a snapshot backup cannot be created with `ON CLUSTER` and cannot be a `base_backup`. The `NAMED COLLECTION` privilege covers named collections used by base backup locators too, and overriding a stored collection parameter needs `SHOW NAMED COLLECTIONS SECRETS`. The Cloud-only `BACKUP FROM SNAPSHOT` and `ALTER TABLE ... UNLOCK SNAPSHOT` state the `READ` source privilege of the snapshot destination, and the `RESTORE` page links the guide section on engines it cannot recreate (a standalone `MaterializedPostgreSQL` table). The session and privilege sentences were observed on a server built from this branch; the snapshot and `MaterializedPostgreSQL` ones follow the code paths that reject them. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Internal second-model review (rounds 1-3)
|
Preview approval requiredThis pull request comes from a fork, so Mintlify won't build a preview until someone with write access approves commit |
|
cc @jkartseva, could you review this? It adds SQL reference pages for BACKUP, RESTORE and ALTER TABLE ... UNLOCK SNAPSHOT (generated from ParserBackupQuery and the ALTER documentation): elements, destinations, archives, ON CLUSTER, privileges and every setting from system.backups.settings; a check of the backup semantics and the Cloud snapshot wording would help. |
Pre-PR validation gate (click to expand)
Session id: cron:clickhouse-impl-slot-6:20261114-153400 |
|
Workflow [PR], commit [1235f2a] Summary: ❌
|
CI finish ledger - 2a59e88Every 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-223011 |
…-statements # Conflicts: # tests/queries/0_stateless/04926_system_statements.reference
ClickHouse#126158 enabled clang-tidy modernize-use-nodiscard (WarningsAsErrors), so the new override fails Build (arm_tidy), as ParserTransactionControl.h:12 does on master. Same spelling as every other getDocumentation override in src/Parsers. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…edPostgreSQL and replica_num rules - `structure_only` still stores the named collections the backup selects, with their values (observed: `data/system/named_collections/<nc>.sql` carries the secret; `backup_named_collections = 0` leaves it out). - `RESTORE` of a `MaterializedPostgreSQL` database fails with CANNOT_RESTORE_DATABASE, also with `create_database = 'must-exist'` (RestorerFromBackup.cpp, observed against PostgreSQL 16). - `replica_num` selects that replica in each shard (BackupSettings::Util::filterHostIDs). Co-Authored-By: Claude Opus 5.5 <[email protected]>
CI finish ledger - e92f9faEvery failure below has an owner: a fixing PR (mine or external), or a full-effort fix task
Session id: cron:our-pr-ci-monitor:20261116-033010 |
|
@groeneai if you add the stubs without the documentation we'll get a blank page deployed. Please add the content as part of this PR. |
The new reference pages were empty AUTOGENERATED stubs that the nightly docs regeneration fills, so deploying this PR before that run would publish blank pages (asked in ClickHouse#131672 (comment)). Fill the generated regions of `backup.mdx`, `restore.mdx` and `alter/unlock-snapshot.mdx`, plus the new `UNLOCK SNAPSHOT` row of the `ALTER` overview table, with the output of master's generator (`autogenerate_docs.py --only 'statement:'`) run against a binary built from this branch. The PR carries the `pr-autogenerated-docs` label. Drop the explicit badge imports from the `BACKUP` and `ALTER TABLE ... UNLOCK SNAPSHOT` descriptions: since ClickHouse#131704 the generator adds the imports of the badges a page renders, which is where the committed pages get them from. Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
Done in |
Related: #131085
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
Document the
BACKUP,RESTOREandALTER TABLE ... UNLOCK SNAPSHOTstatements in the SQL reference.Description
One of the PRs for the statements without reference documentation that @ Blargian asked for in #131085.
BACKUPandRESTOREwere described only in the backup and restore guides, andALTER TABLE ... UNLOCK SNAPSHOTonly in the snapshot backup guide.ParserBackupQuerygets documentation entries forBACKUPandRESTOREand is registered, and theALTERdocumentation gains anALTER TABLE ... UNLOCK SNAPSHOTentry and a row in theALTERoverview. The newbackup.mdx,restore.mdxandalter/unlock-snapshot.mdxpages are committed with their generated content. The pages cover elements, destinations, archives,ON CLUSTER,ASYNC, the result, privileges and everyBACKUP/RESTOREspecific setting with its default, taken fromsystem.backups.settings. The guide overview links the two pages.Each page and section states the version it was introduced in, checked on the release tags.
BACKUPandRESTOREare not behind any setting.BACKUP FROM SNAPSHOT,ALTER TABLE ... UNLOCK SNAPSHOTand theexperimental_lightweight_snapshotsetting are marked experimental and ClickHouse Cloud only; their Cloud behaviour comes from the snapshot guide and the source, so the docs team may want to check that wording. In open-source buildsALTER TABLE ... UNLOCK SNAPSHOTreturns without an error andBACKUP FROM SNAPSHOTfails withBACKUP_IS_EMPTY; not changed here.Validation: I checked the open-source behaviour the pages describe on a server built from this branch (
File,Disk,S3on MinIO,Memory,Null, archives,ON CLUSTER, privileges), and the examples are copied from those runs. I regenerated the pages withautogenerate_docs.py --write --only 'statement:'and ranlychee_check.py(links and redirects, 0 errors; a corrupted anchor is reported),navigation_check.pyandmint validate(no error in these pages). The committed regions match master's generator run against this branch's binary (--check).04926_system_statementsfails without the three new reference lines and passes with them.🤖 Generated with Claude Code
Workflow [PR]
Sync PR [sync-upstream/pr/131672]