Merge pull request #61976 from azat/rmt/stop-merges-primarily

Check for "SYSTEM STOP MERGES" primarily for MERGE_PARTS/MUTATE_PART
This commit is contained in:
Alexander Tokmakov 2024-04-15 12:21:22 +00:00 committed by GitHub
commit 3ddf3e3d5f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1402,6 +1402,13 @@ bool ReplicatedMergeTreeQueue::shouldExecuteLogEntry(
if (entry.type == LogEntry::MERGE_PARTS || entry.type == LogEntry::MUTATE_PART)
{
if (merger_mutator.merges_blocker.isCancelled())
{
constexpr auto fmt_string = "Not executing log entry {} of type {} for part {} because merges and mutations are cancelled now.";
LOG_DEBUG(LogToStr(out_postpone_reason, log), fmt_string, entry.znode_name, entry.typeToString(), entry.new_part_name);
return false;
}
/** If any of the required parts are now fetched or in merge process, wait for the end of this operation.
* Otherwise, even if all the necessary parts for the merge are not present, you should try to make a merge.
* If any parts are missing, instead of merge, there will be an attempt to download a part.
@ -1436,12 +1443,6 @@ bool ReplicatedMergeTreeQueue::shouldExecuteLogEntry(
}
}
}
if (merger_mutator.merges_blocker.isCancelled())
{
constexpr auto fmt_string = "Not executing log entry {} of type {} for part {} because merges and mutations are cancelled now.";
LOG_DEBUG(LogToStr(out_postpone_reason, log), fmt_string, entry.znode_name, entry.typeToString(), entry.new_part_name);
return false;
}
const auto data_settings = data.getSettings();
if (data_settings->allow_remote_fs_zero_copy_replication)