Merge pull request #56677 from ClickHouse/remove-unused-code

Remove unused code
This commit is contained in:
Kseniia Sumarokova 2023-11-17 11:58:26 +01:00 committed by GitHub
commit e0effced0f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 0 additions and 39 deletions

View File

@ -1556,43 +1556,6 @@ std::vector<MergeTreeData::LoadPartResult> MergeTreeData::loadDataPartsFromDisk(
}
void MergeTreeData::loadDataPartsFromWAL(MutableDataPartsVector & parts_from_wal)
{
std::sort(parts_from_wal.begin(), parts_from_wal.end(), [](const auto & lhs, const auto & rhs)
{
return std::tie(lhs->info.level, lhs->info.mutation) > std::tie(rhs->info.level, rhs->info.mutation);
});
for (auto & part : parts_from_wal)
{
part->modification_time = time(nullptr);
auto lo = data_parts_by_state_and_info.lower_bound(DataPartStateAndInfo{DataPartState::Active, part->info});
if (lo != data_parts_by_state_and_info.begin() && (*std::prev(lo))->info.contains(part->info))
continue;
if (lo != data_parts_by_state_and_info.end() && (*lo)->info.contains(part->info))
continue;
part->setState(DataPartState::Active);
LOG_TEST(log, "loadDataPartsFromWAL: inserting {} into data_parts_indexes", part->getNameWithState());
auto [it, inserted] = data_parts_indexes.insert(part);
if (!inserted)
{
if ((*it)->checksums.getTotalChecksumHex() == part->checksums.getTotalChecksumHex())
LOG_ERROR(log, "Remove duplicate part {}", part->getDataPartStorage().getFullPath());
else
throw Exception(ErrorCodes::DUPLICATE_DATA_PART, "Part {} already exists but with different checksums", part->name);
}
else
{
addPartContributionToDataVolume(part);
}
}
}
void MergeTreeData::loadDataParts(bool skip_sanity_checks, std::optional<std::unordered_set<std::string>> expected_parts)
{
LOG_DEBUG(log, "Loading data parts");

View File

@ -1570,8 +1570,6 @@ private:
std::vector<LoadPartResult> loadDataPartsFromDisk(PartLoadingTreeNodes & parts_to_load);
void loadDataPartsFromWAL(MutableDataPartsVector & parts_from_wal);
/// Create zero-copy exclusive lock for part and disk. Useful for coordination of
/// distributed operations which can lead to data duplication. Implemented only in ReplicatedMergeTree.
virtual std::optional<ZeroCopyLock> tryCreateZeroCopyExclusiveLock(const String &, const DiskPtr &) { return std::nullopt; }