mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-09-23 10:10:50 +00:00
Update ReplicatedMergeTreeCleanupThread.cpp
This commit is contained in:
parent
035af6327b
commit
40999bfb0c
@ -131,13 +131,13 @@ void ReplicatedMergeTreeCleanupThread::clearOldLogs()
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void ReplicatedMergeTreeCleanupThread::markLostReplicas(std::unordered_map<String, UInt64> log_pointers_losted_replicas, String min_record)
|
void ReplicatedMergeTreeCleanupThread::markLostReplicas(std::unordered_map<String, UInt64> log_pointers_lost_replicas, String min_record)
|
||||||
{
|
{
|
||||||
auto zookeeper = storage.getZooKeeper();
|
auto zookeeper = storage.getZooKeeper();
|
||||||
|
|
||||||
zkutil::Requests ops;
|
zkutil::Requests ops;
|
||||||
|
|
||||||
for (auto pair : log_pointers_losted_replicas)
|
for (auto pair : log_pointers_lost_replicas)
|
||||||
{
|
{
|
||||||
if ("log-" + padIndex(pair.second) <= min_record)
|
if ("log-" + padIndex(pair.second) <= min_record)
|
||||||
ops.emplace_back(zkutil::makeCreateRequest(storage.zookeeper_path + "/replicas/" + pair.first + "/is_lost", "",
|
ops.emplace_back(zkutil::makeCreateRequest(storage.zookeeper_path + "/replicas/" + pair.first + "/is_lost", "",
|
||||||
@ -145,9 +145,7 @@ void ReplicatedMergeTreeCleanupThread::markLostReplicas(std::unordered_map<Strin
|
|||||||
}
|
}
|
||||||
|
|
||||||
zkutil::Responses responses;
|
zkutil::Responses responses;
|
||||||
auto code = zookeeper->tryMulti(ops, responses);
|
auto code = zookeeper->multi(ops, responses);
|
||||||
if (code && code != ZooKeeperImpl::ZooKeeper::ZNODEEXISTS)
|
|
||||||
throw zkutil::KeeperException(code);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user