mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-17 13:13:36 +00:00
Merge pull request #3928 from yandex/fix_replication_queue_exponential_backoff
Fix exponential backoff for replication queue
This commit is contained in:
commit
d9ab0cfb9f
@ -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::milliseconds(100));
|
||||
|
||||
/// 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