add sync to the test 03352_concurrent_rename_alter.sh#83830
Merged
Conversation
Contributor
This was referenced Jul 16, 2025
tavplubix
approved these changes
Jul 17, 2025
Member
|
Do we have an issue about the root cause of the problem? |
Member
Author
I need to create it. It is not written. |
This was referenced Jul 23, 2025
Member
Author
|
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.
The test is bad actually.
https://fiddle.clickhouse.com/9973867d-2aa6-4061-b4c0-8761e5579b84
It exploit a loophole that allows to alter column type Tuple in a way which extends number of elements. Explicit
MODIFY COLUMNwould throw an error here.This 2 commands
ALTER TABLE t_rename_alter RENAME COLUMN arr TO arr_tmp;ALTER TABLE t_rename_alter RENAME COLUMN arr_v2 TO arr;are converted to 2 alters and 2 mutations
alters:
DROP COLUMN arrADD COLUMN arr Array(Tuple(DateTime, UInt64, String, String, String))(5 elements)mutations:
DROP COLUMN arrMOVE arr_v2 to arr(5 elements)Alter and mutations could be delayed. They are not synchonized.
When we read from the table we could see metadata with column type
arr as Array(Tuple(DateTime, UInt64, String, String, String))but have the files on the disk where columnarr as Array(Tuple(DateTime, UInt64, String, String)).It tries to apply
CAST, but it throws the error.I have added a synchronization. Now all alters and mutations are done before the reading.
When we apply mutations we apply
DROPandMOVEto the files therefore we do not threat old columnarrwith 4 elements in tuple as a new column with 5 elements.Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
...
Documentation entry for user-facing changes