Skip to content

Commit

Permalink
Merge pull request #39016 from Algunenano/clearOldLogs_zkerror
Browse files Browse the repository at this point in the history
clearOldLogs: Don't report KEEPER_EXCEPTION on concurrent deletes
  • Loading branch information
tavplubix authored Jul 11, 2022
2 parents 57a719b + a965438 commit e9ddbc2
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions src/Storages/MergeTree/ReplicatedMergeTreeCleanupThread.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -248,17 +248,17 @@ void ReplicatedMergeTreeCleanupThread::clearOldLogs()
/// Simultaneously with clearing the log, we check to see if replica was added since we received replicas list.
ops.emplace_back(zkutil::makeCheckRequest(storage.zookeeper_path + "/replicas", stat.version));

try
Coordination::Responses responses;
Coordination::Error e = zookeeper->tryMulti(ops, responses);

if (e == Coordination::Error::ZNONODE)
{
zookeeper->multi(ops);
/// Another replica already deleted the same node concurrently.
break;
}
catch (const zkutil::KeeperMultiException & e)
else
{
/// Another replica already deleted the same node concurrently.
if (e.code == Coordination::Error::ZNONODE)
break;

throw;
zkutil::KeeperMultiException::check(e, ops, responses);
}
ops.clear();
}
Expand Down

0 comments on commit e9ddbc2

Please sign in to comment.