v.24.1Improvement
Prohibit Mutable Operations on Read-Only/Write-Once Storage in ClickHouse
Prohibit mutable operations (INSERT/ALTER/OPTIMIZE/...) on read-only/write-once storages with a properTABLE_IS_READ_ONLYerror (to avoid leftovers). Avoid leaving left-overs on write-once disks (format_version.txt) onCREATE/ATTACH. IgnoreDROPforReplicatedMergeTree(so as forMergeTree). Fix iterating overs3_plain(MetadataStorageFromPlainObjectStorage::iterateDirectory). Note read-only iswebdisk, and write-once iss3_plain. #59170 (Azat Khuzhin).
Why it matters
This feature prevents unintended modifications on read-only (likeweb disk type) and write-once (like s3_plain) storages by disallowing mutable table operations. It addresses issues with leftover files (e.g., format_version.txt) that could occur during CREATE or ATTACH on write-once disks, improving data consistency and operational safety. Additionally, it refines behavior for DROP commands on ReplicatedMergeTree tables and fixes iteration over s3_plain storages.How to use it
This behavior is automatic for tables defined on read-only and write-once storages such asweb and s3_plain disks. Users will receive a TABLE_IS_READ_ONLY error when attempting mutable operations on such tables, requiring them to avoid or relocate modifications to appropriate storage types.