mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-10 01:25:21 +00:00
Merge pull request #63595 from ClickHouse/backport/24.3/63513
Backport #63513 to 24.3: Make `MergeTreePrefetchedReadPool` safer
This commit is contained in:
commit
157d6c48fa
@ -53,6 +53,19 @@ void MergeTreeReadPoolBase::fillPerPartInfos()
|
||||
MergeTreeReadTaskInfo read_task_info;
|
||||
|
||||
read_task_info.data_part = part_with_ranges.data_part;
|
||||
|
||||
const auto & data_part = read_task_info.data_part;
|
||||
if (data_part->isProjectionPart())
|
||||
{
|
||||
read_task_info.parent_part = data_part->storage.getPartIfExists(
|
||||
data_part->getParentPartName(),
|
||||
{MergeTreeDataPartState::PreActive, MergeTreeDataPartState::Active, MergeTreeDataPartState::Outdated});
|
||||
|
||||
if (!read_task_info.parent_part)
|
||||
throw Exception(ErrorCodes::LOGICAL_ERROR, "Did not find parent part {} for projection part {}",
|
||||
data_part->getParentPartName(), data_part->getDataPartStorage().getFullPath());
|
||||
}
|
||||
|
||||
read_task_info.part_index_in_query = part_with_ranges.part_index_in_query;
|
||||
read_task_info.alter_conversions = part_with_ranges.alter_conversions;
|
||||
|
||||
|
@ -56,6 +56,8 @@ struct MergeTreeReadTaskInfo
|
||||
{
|
||||
/// Data part which should be read while performing this task
|
||||
DataPartPtr data_part;
|
||||
/// Parent part of the projection part
|
||||
DataPartPtr parent_part;
|
||||
/// For `part_index` virtual column
|
||||
size_t part_index_in_query;
|
||||
/// Alter converversionss that should be applied on-fly for part.
|
||||
|
Loading…
Reference in New Issue
Block a user