check for active replicas when waiting for commands

This commit is contained in:
Javi santana bot 2019-12-20 11:00:21 +01:00
parent b864bc49b9
commit dd5435501a

View File

@ -3844,9 +3844,15 @@ void StorageReplicatedMergeTree::waitForAllReplicasToProcessLogEntry(const Repli
{
LOG_DEBUG(log, "Waiting for all replicas to process " << entry.znode_name);
Strings replicas = getZooKeeper()->getChildren(zookeeper_path + "/replicas");
auto zookeeper = getZooKeeper()
Strings replicas = zookeeper->getChildren(zookeeper_path + "/replicas");
for (const String & replica : replicas)
waitForReplicaToProcessLogEntry(replica, entry);
{
if (zookeeper->exists(zookeeper_path + "/replicas/" + replica + "/is_active"))
{
waitForReplicaToProcessLogEntry(replica, entry);
}
}
LOG_DEBUG(log, "Finished waiting for all replicas to process " << entry.znode_name);
}