Repository navigation
Document missing SYSTEM cache statements - #108546
Conversation
Adds the SYSTEM cache commands that were missing from the system statements docs: - DROP PRIMARY INDEX CACHE (DOC-848), INDEX MARK CACHE, INDEX UNCOMPRESSED CACHE, MMAP CACHE, PAGE CACHE, VECTOR SIMILARITY INDEX CACHE, CONNECTIONS CACHE, S3 CLIENT CACHE - PREWARM MARK CACHE and PREWARM PRIMARY INDEX CACHE - DISK METADATA CACHE, SYNC FILESYSTEM CACHE, and DROP DISTRIBUTED CACHE (ClickHouse Cloud) Also fixes the TEXT INDEX CACHES section, which referred to a "dictionary" cache; the code clears a "tokens" cache. Commands, verbs and syntax were taken from ParserSystemQuery.cpp and InterpreterSystemQuery.cpp. Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
|
Workflow [PR], commit [c519d9a] Summary: ✅ AI ReviewSummaryThis PR fills missing Missing context / blind spots
Findings
Tests
Final VerdictStatus: Minimum required action: fix or remove the documented |
…name Address review feedback: - SYSTEM PREWARM MARK CACHE also loads secondary-index marks into the index mark cache. - SYSTEM SYNC FILESYSTEM CACHE takes the cache name as a string literal, so document it quoted. Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
| ``` | ||
|
|
||
| ## SYSTEM CLEAR|DROP DISK METADATA CACHE {#drop-disk-metadata-cache} | ||
|
|
There was a problem hiding this comment.
The documented ON CLUSTER form does not currently honor the privilege for this command. Local execution of SYSTEM PREWARM PRIMARY INDEX CACHE calls prewarmPrimaryIndexCache and checks AccessType::SYSTEM_PREWARM_PRIMARY_INDEX_CACHE, but the DDL-on-cluster path in InterpreterSystemQuery::getRequiredAccessForDDLOnCluster still records AccessType::SYSTEM_PREWARM_MARK_CACHE for Type::PREWARM_PRIMARY_INDEX_CACHE. A user granted only the documented primary-index prewarm privilege will therefore be denied before the query is sent to the cluster, unless they also have the separate mark-cache prewarm privilege. Please switch that required access element to SYSTEM_PREWARM_PRIMARY_INDEX_CACHE and add a small access test for the ON CLUSTER form, or drop ON CLUSTER from the docs if it is intentionally unsupported.
There was a problem hiding this comment.
To confirm: it's a pre-existing core access-control bug, not introduced by this PR. The Type::PREWARM_PRIMARY_INDEX_CACHE case in getRequiredAccessForDDLOnCluster() (L2736) records SYSTEM_PREWARM_MARK_CACHE, while local execution (L2444) checks SYSTEM_PREWARM_PRIMARY_INDEX_CACHE.
The documented ON CLUSTER syntax itself is correct, intended form; only the privilege mapping on the cluster path is wrong. Since this is a code fix in access control (plus a focused test) and outside the scope of a docs-only PR, I've filed it separately as #108956 for the access-control owner. Keeping this PR docs-only.
…-system-drop-primary-index-cache Document missing SYSTEM cache statements
What
DOC-848 reported that
SYSTEM DROP PRIMARY INDEX CACHEwas missing from the system statements docs. While adding it, I swept theSYSTEMcommand enum against the docs and found 13 undocumented cache commands in total, so this PR documents the whole set.Added sections:
PRIMARY INDEX CACHE,INDEX MARK CACHE,INDEX UNCOMPRESSED CACHE,MMAP CACHE,PAGE CACHE,VECTOR SIMILARITY INDEX CACHE,CONNECTIONS CACHE,S3 CLIENT CACHEPREWARM MARK CACHE,PREWARM PRIMARY INDEX CACHE(with[ON CLUSTER] db.tablesyntax)DISK METADATA CACHE(targets a disk),SYNC FILESYSTEM CACHE(returns a result set),DROP DISTRIBUTED CACHE(ClickHouse Cloud, with a Cloud-only note)Also fixes the existing TEXT INDEX CACHES section: it referred to a "dictionary" cache, but the code clears a tokens cache (
clearTextIndexTokensCache).How it was verified
CLEAR/DROPsynonyms), and syntax fromsrc/Parsers/ParserSystemQuery.cpp.src/Interpreters/InterpreterSystemQuery.cpp.One caveat:
DROP DISTRIBUTED CACHEhas no open-source execution handler (it's a ClickHouse Cloud feature), so it's documented from its parser syntax + Cloud-only status with a conservative description — worth a Cloud-team sanity check on the wording.Changelog category (leave one):
Version info
26.7.1.314(included in26.7and later)