mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-22 07:31:57 +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 QUEUE_UPDATE_ERROR_SLEEP_MS = 1 * 1000;
|
||||||
static const auto MERGE_SELECTING_SLEEP_MS = 5 * 1000;
|
static const auto MERGE_SELECTING_SLEEP_MS = 5 * 1000;
|
||||||
static const auto MUTATIONS_FINALIZING_SLEEP_MS = 1 * 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)
|
void StorageReplicatedMergeTree::setZooKeeper(zkutil::ZooKeeperPtr zookeeper)
|
||||||
@ -2284,8 +2285,19 @@ void StorageReplicatedMergeTree::mutationsFinalizingTask()
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (needs_reschedule)
|
if (needs_reschedule)
|
||||||
|
{
|
||||||
mutations_finalizing_task->scheduleAfter(MUTATIONS_FINALIZING_SLEEP_MS);
|
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);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
bool StorageReplicatedMergeTree::createLogEntryToMergeParts(
|
bool StorageReplicatedMergeTree::createLogEntryToMergeParts(
|
||||||
|
Loading…
Reference in New Issue
Block a user