mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-09 17:14:47 +00:00
Limit min_marks_for_concurrent_read
This commit is contained in:
parent
936e3d9a21
commit
c5a2f3aafb
@ -383,9 +383,12 @@ Pipe ReadFromMergeTree::readFromPoolParallelReplicas(RangesInDataParts parts_wit
|
||||
/// We have a special logic for local replica. It has to read less data, because in some cases it should
|
||||
/// merge states of aggregate functions or do some other important stuff other than reading from Disk.
|
||||
auto multiplier = context->getSettingsRef().parallel_replicas_single_task_marks_count_multiplier;
|
||||
// avoid using multiplier if min marks to read is already too big (to avoid overflow)
|
||||
if (pool_settings.min_marks_for_concurrent_read >= std::numeric_limits<Int64>::max())
|
||||
if (pool_settings.min_marks_for_concurrent_read > std::numeric_limits<Int64>::max())
|
||||
{
|
||||
/// limit min marks to read in case it's big, happened in test since due to settings randomzation
|
||||
pool_settings.min_marks_for_concurrent_read = std::numeric_limits<Int64>::max();
|
||||
multiplier = 1.0f;
|
||||
}
|
||||
|
||||
if (auto result = pool_settings.min_marks_for_concurrent_read * multiplier; canConvertTo<size_t>(result))
|
||||
pool_settings.min_marks_for_concurrent_read = static_cast<size_t>(result);
|
||||
@ -556,9 +559,12 @@ Pipe ReadFromMergeTree::readInOrder(
|
||||
};
|
||||
|
||||
auto multiplier = context->getSettingsRef().parallel_replicas_single_task_marks_count_multiplier;
|
||||
// avoid using multiplier if min marks to read is already too big (to avoid overflow)
|
||||
if (pool_settings.min_marks_for_concurrent_read >= std::numeric_limits<Int64>::max())
|
||||
if (pool_settings.min_marks_for_concurrent_read > std::numeric_limits<Int64>::max())
|
||||
{
|
||||
/// limit min marks to read in case it's big, happened in test since due to settings randomzation
|
||||
pool_settings.min_marks_for_concurrent_read = std::numeric_limits<Int64>::max();
|
||||
multiplier = 1.0f;
|
||||
}
|
||||
|
||||
if (auto result = pool_settings.min_marks_for_concurrent_read * multiplier; canConvertTo<size_t>(result))
|
||||
pool_settings.min_marks_for_concurrent_read = static_cast<size_t>(result);
|
||||
|
Loading…
Reference in New Issue
Block a user