mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-21 15:12:02 +00:00
Finalize mutations in background (#10526)
This commit is contained in:
parent
f34a6dc482
commit
228dbf475e
@ -129,6 +129,7 @@ namespace ActionLocks
|
||||
static const auto QUEUE_UPDATE_ERROR_SLEEP_MS = 1 * 1000;
|
||||
static const auto MERGE_SELECTING_SLEEP_MS = 5 * 1000;
|
||||
static const auto MUTATIONS_FINALIZING_SLEEP_MS = 1 * 1000;
|
||||
static const auto MUTATIONS_FINALIZING_IDLE_SLEEP_MS = 5 * 1000;
|
||||
|
||||
|
||||
void StorageReplicatedMergeTree::setZooKeeper(zkutil::ZooKeeperPtr zookeeper)
|
||||
@ -2284,7 +2285,18 @@ void StorageReplicatedMergeTree::mutationsFinalizingTask()
|
||||
}
|
||||
|
||||
if (needs_reschedule)
|
||||
{
|
||||
mutations_finalizing_task->scheduleAfter(MUTATIONS_FINALIZING_SLEEP_MS);
|
||||
}
|
||||
else
|
||||
{
|
||||
/// Even if no mutations seems to be done or appeared we are trying to
|
||||
/// finalize them in background because manual control the launch of
|
||||
/// this function is error prone. This can lead to mutations that
|
||||
/// processed all the parts but have is_done=0 state for a long time. Or
|
||||
/// killed mutations, which are also considered as undone.
|
||||
mutations_finalizing_task->scheduleAfter(MUTATIONS_FINALIZING_IDLE_SLEEP_MS);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user