Merge pull request #41856 from ClickHouse/fix_possible_no_such_key

Remove two redundant lines
This commit is contained in:
alesapin 2022-09-28 15:05:55 +02:00 committed by GitHub
commit 1d9e126f94
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1408,31 +1408,23 @@ MergeTreeData::DataPartsVector StorageReplicatedMergeTree::checkPartChecksumsAnd
ops = std::move(new_ops);
}
try
{
Coordination::Responses responses;
Coordination::Error e = zookeeper->tryMulti(ops, responses);
if (e == Coordination::Error::ZOK)
return transaction.commit();
Coordination::Responses responses;
Coordination::Error e = zookeeper->tryMulti(ops, responses);
if (e == Coordination::Error::ZOK)
return transaction.commit();
if (e == Coordination::Error::ZNODEEXISTS)
if (e == Coordination::Error::ZNODEEXISTS)
{
size_t num_check_ops = 2 * absent_part_paths_on_replicas.size();
size_t failed_op_index = zkutil::getFailedOpIndex(e, responses);
if (failed_op_index < num_check_ops)
{
size_t num_check_ops = 2 * absent_part_paths_on_replicas.size();
size_t failed_op_index = zkutil::getFailedOpIndex(e, responses);
if (failed_op_index < num_check_ops)
{
LOG_INFO(log, "The part {} on a replica suddenly appeared, will recheck checksums", ops[failed_op_index]->getPath());
continue;
}
LOG_INFO(log, "The part {} on a replica suddenly appeared, will recheck checksums", ops[failed_op_index]->getPath());
continue;
}
}
throw zkutil::KeeperException(e);
}
catch (const std::exception &)
{
unlockSharedData(*part);
throw;
}
throw zkutil::KeeperException(e);
}
}
@ -8153,7 +8145,6 @@ bool StorageReplicatedMergeTree::createEmptyPartInsteadOfLost(zkutil::ZooKeeperP
}
catch (const Exception & ex)
{
unlockSharedData(*new_data_part);
LOG_WARNING(log, "Cannot commit empty part {} with error {}", lost_part_name, ex.displayText());
return false;
}