mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-10 09:32:06 +00:00
Revert "Add backoff to merges in replicated queue if always_fetch_merged_part
is enabled"
This commit is contained in:
parent
9794098ebb
commit
56f2121c1a
@ -1256,27 +1256,6 @@ bool ReplicatedMergeTreeQueue::shouldExecuteLogEntry(
|
||||
{
|
||||
ignore_max_size = max_source_parts_size == data_settings->max_bytes_to_merge_at_max_space_in_pool;
|
||||
|
||||
if (data_settings->always_fetch_merged_part && entry.num_tries > 0)
|
||||
{
|
||||
static constexpr auto MAX_SECONDS_TO_WAIT = 300L;
|
||||
static constexpr auto BACKOFF_SECONDS = 3;
|
||||
|
||||
auto time_to_wait_seconds = std::min<int64_t>(MAX_SECONDS_TO_WAIT, entry.num_tries * BACKOFF_SECONDS);
|
||||
auto time_since_last_try_seconds = std::time(nullptr) - entry.last_attempt_time;
|
||||
/// Otherwise we will constantly look for part on other replicas
|
||||
/// and load zookeeper too much.
|
||||
if (time_to_wait_seconds > time_since_last_try_seconds)
|
||||
{
|
||||
out_postpone_reason = fmt::format(
|
||||
"Not executing log entry ({}) to merge parts for part {} because `always_fetch_merged_part` enabled and "
|
||||
" not enough time had been passed since last try, have to wait {} seconds",
|
||||
entry.znode_name, entry.new_part_name, time_to_wait_seconds - time_since_last_try_seconds);
|
||||
|
||||
LOG_DEBUG(log, fmt::runtime(out_postpone_reason));
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
if (isTTLMergeType(entry.merge_type))
|
||||
{
|
||||
if (merger_mutator.ttl_merges_blocker.isCancelled())
|
||||
|
Loading…
Reference in New Issue
Block a user