Update metadata on replica recovery#23742
Merged
Conversation
alesapin
approved these changes
May 7, 2021
| /// Our metadata it not up to date with source replica metadata. | ||
| /// Metadata is updated by ALTER_METADATA entries, but some entries are probably cleaned up from the log. | ||
| /// It's also possible that some newer ALTER_METADATA entries are present in source_queue list, | ||
| /// and source replica are executing such entry right not (or had executed recently). |
Member
There was a problem hiding this comment.
Suggested change
| /// and source replica are executing such entry right not (or had executed recently). | |
| /// and source replica are executing such entry right now (or had executed recently). |
| int alter_version = -1; /// May be equal to -1, if it's normal mutation, not metadata update. | ||
|
|
||
| /// only ALTER METADATA command | ||
| /// TODO Seems like it's never used |
|
|
||
| zookeeper->create(replica_path + "/queue/queue-", dummy_alter.toString(), zkutil::CreateMode::PersistentSequential); | ||
|
|
||
| /// TODO Do we also need to do something with mutation_pointer? Seems like we don't, but it's not clear from the code. |
Member
There was a problem hiding this comment.
Definitely yes, we shouldn't do anything here, but our mutation pointer must be equal with the source replica's pointer?
Member
Author
There was a problem hiding this comment.
No, it may be less than mutation pointer of the source replica
This was referenced May 8, 2021
robot-clickhouse
pushed a commit
that referenced
this pull request
May 8, 2021
robot-clickhouse
pushed a commit
that referenced
this pull request
May 8, 2021
robot-clickhouse
pushed a commit
that referenced
this pull request
May 8, 2021
tavplubix
added a commit
that referenced
this pull request
May 9, 2021
Backport #23742 to 21.3: Update metadata on replica recovery
tavplubix
added a commit
that referenced
this pull request
May 9, 2021
Backport #23742 to 21.5: Update metadata on replica recovery
tavplubix
added a commit
that referenced
this pull request
May 9, 2021
Backport #23742 to 21.4: Update metadata on replica recovery
robot-clickhouse
pushed a commit
that referenced
this pull request
May 28, 2021
tavplubix
added a commit
that referenced
this pull request
Jun 4, 2021
Backport #23742 to 20.8: Update metadata on replica recovery
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.
I hereby agree to the terms of the CLA available at: https://yandex.ru/legal/cla/?lang=en
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes to CHANGELOG.md):
Fixed a bug in recovery of staled
ReplicatedMergeTreereplica. Some metadata updates could be ignored by staled replica ifALTERquery was executed during downtime of the replica.