Turn off tasks stealing for remote disk

This commit is contained in:
kssenii 2021-10-10 23:22:58 +03:00
parent eb5cb86271
commit aa4b797808
7 changed files with 21 additions and 0 deletions

View File

@ -95,6 +95,8 @@ public:
virtual bool isStoredOnDisk() const = 0;
virtual bool isStoredOnRemoteDisk() const = 0;
virtual bool supportsVerticalMerge() const { return false; }
/// NOTE: Returns zeros if column files are not found in checksums.

View File

@ -182,6 +182,11 @@ void MergeTreeDataPartCompact::checkConsistency(bool require_part_metadata) cons
}
}
bool MergeTreeDataPartCompact::isStoredOnRemoteDisk() const
{
return volume->getDisk()->isRemote();
}
MergeTreeDataPartCompact::~MergeTreeDataPartCompact()
{
removeIfNeeded();

View File

@ -56,6 +56,8 @@ public:
bool isStoredOnDisk() const override { return true; }
bool isStoredOnRemoteDisk() const override;
bool hasColumnFiles(const NameAndTypePair & column) const override;
String getFileNameForColumn(const NameAndTypePair & /* column */) const override { return DATA_FILE_NAME; }

View File

@ -44,6 +44,7 @@ public:
const MergeTreeIndexGranularity & computed_index_granularity) const override;
bool isStoredOnDisk() const override { return false; }
bool isStoredOnRemoteDisk() const override { return false; }
bool hasColumnFiles(const NameAndTypePair & column) const override { return !!getColumnPosition(column.name); }
String getFileNameForColumn(const NameAndTypePair & /* column */) const override { return ""; }
void renameTo(const String & new_relative_path, bool remove_new_dir_if_exists) const override;

View File

@ -142,6 +142,11 @@ void MergeTreeDataPartWide::loadIndexGranularity()
index_granularity.setInitialized();
}
bool MergeTreeDataPartWide::isStoredOnRemoteDisk() const
{
return volume->getDisk()->isRemote();
}
MergeTreeDataPartWide::~MergeTreeDataPartWide()
{
removeIfNeeded();

View File

@ -50,6 +50,8 @@ public:
bool isStoredOnDisk() const override { return true; }
bool isStoredOnRemoteDisk() const override;
bool supportsVerticalMerge() const override { return true; }
String getFileNameForColumn(const NameAndTypePair & column) const override;

View File

@ -221,6 +221,10 @@ std::vector<size_t> MergeTreeReadPool::fillPerPartInfo(
{
const auto & part = parts[i];
/// Turn off tasks stealing in case there is remote disk.
if (part.data_part->isStoredOnRemoteDisk())
do_not_steal_tasks = true;
/// Read marks for every data part.
size_t sum_marks = 0;
for (const auto & range : part.ranges)