mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-26 17:41:59 +00:00
Update StorageReplicatedMergeTree.cpp
This commit is contained in:
parent
617ee5abaf
commit
a3cba8e06f
@ -1835,9 +1835,13 @@ MergeTreeData::DataPartsVector StorageReplicatedMergeTree::checkPartChecksumsAnd
|
||||
return {};
|
||||
}
|
||||
|
||||
size_t retries_count = 0;
|
||||
constexpr size_t MAX_RETRIES_ON_SHUTDOWN = 3;
|
||||
while (true)
|
||||
{
|
||||
if (shutdown_called || partial_shutdown_called)
|
||||
/// It still makes sense to make a few attempts on shutdown because we already did some job to create a part
|
||||
/// and also we want to reduce the probability of issues with unexpected parts on restart
|
||||
if (++retries_count > MAX_RETRIES_ON_SHUTDOWN && (shutdown_called || partial_shutdown_called))
|
||||
throw Exception(ErrorCodes::ABORTED, "Cannot commit part because shutdown called");
|
||||
|
||||
Coordination::Requests ops;
|
||||
|
Loading…
Reference in New Issue
Block a user