Repository navigation
Add table_readonly MergeTree setting - #97652
Merged
Merged
Conversation
Contributor
alexey-milovidov
force-pushed
the
table-readonly-setting
branch
2 times, most recently
from
February 22, 2026 20:06
757ff0c to
0fa4655
Compare
alexey-milovidov
marked this pull request as draft
February 23, 2026 13:11
alexey-milovidov
force-pushed
the
table-readonly-setting
branch
from
February 26, 2026 21:03
4c5a408 to
1826e4d
Compare
Add a new `table_readonly` MergeTree setting that marks a table as read-only. When enabled, inserts and mutations are rejected with `TABLE_IS_READ_ONLY`. ALTER MODIFY SETTING / RESET SETTING are still allowed so the flag can be toggled back. When `table_readonly` is set, outdated parts are not loaded on startup since the table will never own them. Co-Authored-By: Claude Opus 4.6 <[email protected]>
Co-Authored-By: Claude Opus 4.6 <[email protected]>
alexey-milovidov
force-pushed
the
table-readonly-setting
branch
from
February 27, 2026 20:50
1826e4d to
e516e85
Compare
alexey-milovidov
marked this pull request as ready for review
February 27, 2026 20:50
… history The merge of master into the branch left a duplicate `table_readonly` entry in the 26.2 section (it belongs only in 26.3), along with a missing comma causing a syntax error. Co-Authored-By: Claude Opus 4.6 <[email protected]>
alexey-milovidov
added a commit
that referenced
this pull request
Mar 1, 2026
Add `table_readonly` MergeTree setting
Member
|
With: <remote_servers>
<cluster0>
<shard>
<replica>
<host>localhost</host>
<port>9000</port>
</replica>
</shard>
</cluster0>
</remote_servers>If I run: CREATE TABLE t0 ON CLUSTER 'cluster0' (c0 Int) ENGINE = MergeTree() ORDER BY tuple() SETTINGS table_readonly = 1;
OPTIMIZE TABLE t0 ON CLUSTER 'cluster0'; --hangsIs this expected? Maybe not. |
Member
Author
|
It's a minor problem - specifically about DDL queries in Replicated databases. |
Member
|
@alexey-milovidov but it has very weird behavior with replicated merge tree. It must be explicitly banned for all engines except ordinary MergeTree or it must be supported. Now someone can enable it for ReplicatedMergeTree and during startup table will not load oudated parts (which is crucial in some cases). |
1 task
1 task
1 task
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
table_readonlyMergeTree setting that marks a table as read-onlyTABLE_IS_READ_ONLYALTER MODIFY SETTING/RESET SETTINGare still allowed so the flag can be toggled backtable_readonlyis set, outdated parts are not loaded on startup since the table will never own themThis setting is split out from #95079 to be introduced independently of its usage in system log rotation.
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
Add
table_readonlyMergeTree setting to mark tables as read-only, preventing inserts and modifications.🤖 Generated with Claude Code
Version info
26.3.1.175