mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-26 17:41:59 +00:00
Fix exponential backoff for replication queue
This commit is contained in:
parent
8f306e8b45
commit
444eb21d28
@ -2077,7 +2077,16 @@ bool StorageReplicatedMergeTree::queueTask()
|
||||
LogEntryPtr & entry = selected.first;
|
||||
|
||||
if (!entry)
|
||||
return false;
|
||||
{
|
||||
/// Nothing to do, we can sleep for some time, just not to
|
||||
/// abuse background pool scheduling policy
|
||||
std::this_thread::sleep_for(std::chrono::seconds(5));
|
||||
|
||||
/// If we return false, than background pool for this task
|
||||
/// will accumulate exponential backoff and after empty replication queue
|
||||
/// we will sleep for a long time
|
||||
return true;
|
||||
}
|
||||
|
||||
time_t prev_attempt_time = entry->last_attempt_time;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user