mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-21 23:21:59 +00:00
Fixed error when parts of unlimited total size could be selected for merge in case of low free disk space [#CLICKHOUSE-2895].
This commit is contained in:
parent
d98c95ddcd
commit
d3ae1267eb
@ -319,7 +319,9 @@ bool StorageMergeTree::merge(
|
||||
|
||||
if (partition.empty())
|
||||
{
|
||||
selected = merger.selectPartsToMerge(parts, merged_name, aggressive, merger.getMaxPartsSizeForMerge(), can_merge);
|
||||
size_t max_parts_size_for_merge = merger.getMaxPartsSizeForMerge();
|
||||
if (max_parts_size_for_merge > 0)
|
||||
selected = merger.selectPartsToMerge(parts, merged_name, aggressive, max_parts_size_for_merge, can_merge);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -1760,10 +1760,13 @@ void StorageReplicatedMergeTree::mergeSelectingThread()
|
||||
MergeTreeData::DataPartsVector parts;
|
||||
String merged_name;
|
||||
|
||||
if (merger.selectPartsToMerge(
|
||||
parts, merged_name, false,
|
||||
merger.getMaxPartsSizeForMerge(data.settings.max_replicated_merges_in_queue, merges_queued),
|
||||
can_merge)
|
||||
size_t max_parts_size_for_merge = merger.getMaxPartsSizeForMerge(data.settings.max_replicated_merges_in_queue, merges_queued);
|
||||
|
||||
if (max_parts_size_for_merge > 0
|
||||
&& merger.selectPartsToMerge(
|
||||
parts, merged_name, false,
|
||||
max_parts_size_for_merge,
|
||||
can_merge)
|
||||
&& createLogEntryToMergeParts(parts, merged_name))
|
||||
{
|
||||
success = true;
|
||||
|
Loading…
Reference in New Issue
Block a user