Update DatabaseReplicated.cpp

This commit is contained in:
Alexander Tokmakov 2024-04-25 20:34:08 +02:00 committed by GitHub
parent f85d967f11
commit 9de7a95178
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1139,8 +1139,10 @@ void DatabaseReplicated::recoverLostReplica(const ZooKeeperPtr & current_zookeep
}
LOG_INFO(log, "All tables are created successfully");
chassert(max_log_ptr_at_creation || our_log_ptr);
UInt32 first_entry_to_mark_finished = new_replica ? max_log_ptr_at_creation : our_log_ptr;
/// NOTE first_entry_to_mark_finished can be 0 if our replica has crashed just after creating its nodes in ZK,
/// so it's a new replica, but after restarting we don't know max_log_ptr_at_creation anymore...
/// It's a very rare case, and it's okay if some queries throw TIMEOUT_EXCEEDED when waiting for all replicas
if (first_entry_to_mark_finished)
{
/// If the replica is new and some of the queries applied during recovery