Repository navigation
Cherry pick #114188 to 26.7: Ignore redundant parentheses in stored table definitions - #114655
Merged
robot-ch-test-poll2 merged 11 commits intoAug 13, 2026
Merged
Conversation
The definition expressions of a table (keys, `TTL`, indices, projections, constraints, column defaults) are stored in ZooKeeper as text and compared as text. #92340 made the AST remember the redundant parentheses the user wrote, so `PARTITION BY (a)` stopped comparing equal to `PARTITION BY a`, and `ATTACH`/`REPLACE`/`MOVE PARTITION FROM` and adding a replica started to fail. Format those definitions with a new `ignore_redundant_parentheses` mode, which gives back the text every server produced before the parentheses were a part of the AST. What the user wrote is still stored in the table metadata and still shown by `SHOW CREATE`; only the comparisons and the Keeper payload became insensitive to it. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
…es-in-stored-metadata
…ageQueue metadata The `columns` field of the ObjectStorageQueue metadata in ZooKeeper was compared with the local serialization verbatim, so a queue table created by a version that kept the redundant parentheses of the user in a column `DEFAULT`, `CODEC` or `TTL` expression (26.5-26.7) would fail with `METADATA_MISMATCH` on a server that does not store them (and the other way around). When the strings differ, compare the parsed `ColumnsDescription` structurally, like `StorageKeeperMap` already does. Co-Authored-By: Claude Fable 5 <[email protected]>
…es-in-stored-metadata
… when reusing a partially created replica A retry of a partially created replica could find `/metadata` and `/columns` written by a server version with a different (redundantly parenthesized) spelling of the same table definition; the raw string comparison in `createReplicaAttempt` then failed with `REPLICA_ALREADY_EXISTS`. Fall back to structural comparison (`ReplicatedMergeTreeTableMetadata::checkEquals` / `ColumnsDescription::parse`) when the texts differ. Co-Authored-By: Claude Fable 5 <[email protected]>
…spellings The test hand-crafts the ZooKeeper nodes of a replica as a 26.5..26.7 server would have left them after failing between the ZooKeeper transaction and saving the local metadata: the same definitions, spelled with redundant parentheses. Retrying `CREATE TABLE` must reuse the empty replica instead of throwing `REPLICA_ALREADY_EXISTS`. Co-Authored-By: Claude Fable 5 <[email protected]>
…es-in-stored-metadata
…adata propagate Per review: do not swallow exceptions in `createReplicaAttempt` when comparing the `metadata` and `columns` of an existing empty replica. A structural mismatch or an unparseable node now throws (e.g. `METADATA_MISMATCH`), which describes the problem better than the `REPLICA_ALREADY_EXISTS` of the fall-through create attempt. This also resolves the style-check finding about silent `catch (...)`. Co-Authored-By: Claude Fable 5 <[email protected]>
…04850 test The style check requires shell tests to include it in `ReplicatedMergeTree` paths to avoid overlaps between concurrent test runs. Co-Authored-By: Claude Fable 5 <[email protected]>
…tored-metadata Ignore redundant parentheses in stored table definitions
…ypick/26.7/114188 # Conflicts: # src/Parsers/IAST.cpp
Member
|
Conflicts resolved. The change itself is taken verbatim - the resulting diff against Only All 11 changed translation units were compile-checked against this branch's sources. |
This was referenced Aug 13, 2026
Merged
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.
Original pull-request #114188
Do not merge this PR manually
This pull-request is a first step of an automated backporting.
It contains changes similar to calling
git cherry-picklocally.If you intend to continue backporting the changes, then resolve all conflicts if any.
Otherwise, if you do not want to backport them, then just close this pull-request.
The check results does not matter at this step - you can safely ignore them.
Troubleshooting
If the conflicts were resolved in a wrong way
If this cherry-pick PR is completely screwed by a wrong conflicts resolution, and you want to recreate it:
pr-cherrypicklabel from the PRYou also need to check the Original pull-request for
pr-backports-createdlabel, and delete if it's presented thereThe PR source
The PR is created in the CI job