Improvements in lost replica recovery#15701
Merged
Conversation
Member
Author
|
Integration tests (release) - test_always_fetch_merged/test.py::test_replica_always_download - flacky |
alesapin
approved these changes
Oct 7, 2020
| /// For compatibility with older ClickHouse versions | ||
| get_is_lost.stat.version = -1; | ||
| } | ||
| else if (get_is_lost.data != "0") |
| if (!log_entries.empty()) | ||
| { | ||
| String last_entry_num = std::max_element(log_entries.begin(), log_entries.end())->substr(4); | ||
| max_log_entry = std::stol(last_entry_num); |
Member
There was a problem hiding this comment.
parse<UInt64>(last_entry_num.substr(strlen("log-"))) looks more clear
| if (source_replica.empty()) | ||
| throw Exception("All replicas are lost", ErrorCodes::ALL_REPLICAS_LOST); | ||
|
|
||
| if (is_new_replica) |
Member
There was a problem hiding this comment.
let's also add info about source queue size and log pointer.
Member
Author
There was a problem hiding this comment.
Maybe add log pointer here?
Member
Author
|
AST fuzzer - known issue |
This was referenced Oct 8, 2020
robot-clickhouse
pushed a commit
that referenced
this pull request
Oct 8, 2020
robot-clickhouse
pushed a commit
that referenced
this pull request
Oct 8, 2020
robot-clickhouse
pushed a commit
that referenced
this pull request
Oct 8, 2020
tavplubix
added a commit
that referenced
this pull request
Oct 9, 2020
Backport #15701 to 20.9: Improvements in lost replica recovery
tavplubix
added a commit
that referenced
this pull request
Oct 9, 2020
Backport #15701 to 20.8: Improvements in lost replica recovery
tavplubix
added a commit
that referenced
this pull request
Oct 9, 2020
Backport #15701 to 20.7: Improvements in lost 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 too low default value of
max_replicated_logs_to_keepsetting, which might cause replicas to become lost too often. Improve lost replica recovery process by choosing the most up-to-date replica to clone. Also do not remove old parts from lost replica, detach them instead.