From fa0e61086f8f671789ef805d3cbcda4d003db3b9 Mon Sep 17 00:00:00 2001 From: Alexey Milovidov Date: Wed, 16 Sep 2015 08:09:58 +0300 Subject: [PATCH] dbms: removed bad code [#METR-17988]. --- .../MergeTree/ReplicatedMergeTreeBlockOutputStream.h | 3 --- dbms/src/Storages/MergeTree/MergeTreeData.cpp | 11 ----------- 2 files changed, 14 deletions(-) diff --git a/dbms/include/DB/Storages/MergeTree/ReplicatedMergeTreeBlockOutputStream.h b/dbms/include/DB/Storages/MergeTree/ReplicatedMergeTreeBlockOutputStream.h index 78200c3efd1..6120f7a9856 100644 --- a/dbms/include/DB/Storages/MergeTree/ReplicatedMergeTreeBlockOutputStream.h +++ b/dbms/include/DB/Storages/MergeTree/ReplicatedMergeTreeBlockOutputStream.h @@ -201,13 +201,10 @@ public: /// Если данные отличались от тех, что были вставлены ранее с тем же ID, бросим исключение. expected_checksums.checkEqual(part->checksums, true); - /// У part-а уменьшится refcount, и его смогут удалить сразу при откате транзакции, а не позже. - part.reset(); transaction.rollback(); } else if (zookeeper->exists(quorum_status_path)) { - part.reset(); transaction.rollback(); throw Exception("Another quorum insert has been already started", ErrorCodes::UNSATISFIED_QUORUM_FOR_PREVIOUS_WRITE); diff --git a/dbms/src/Storages/MergeTree/MergeTreeData.cpp b/dbms/src/Storages/MergeTree/MergeTreeData.cpp index 7e309fac9f9..cd1a1f295e3 100644 --- a/dbms/src/Storages/MergeTree/MergeTreeData.cpp +++ b/dbms/src/Storages/MergeTree/MergeTreeData.cpp @@ -799,17 +799,6 @@ void MergeTreeData::replaceParts(const DataPartsVector & remove, const DataParts part->remove_time = clear_without_timeout ? 0 : time(0); removePartContributionToColumnSizes(part); data_parts.erase(part); - - /// use_count равен двум, если part-ом владеет только remove и all_data_parts. - if (clear_without_timeout && part.use_count() <= 2) - { - LOG_DEBUG(log, "Removing part " << part->name); - part->remove(); - - Poco::ScopedLock lock_all(all_data_parts_mutex); - all_data_parts.erase(part); - } - /// Иначе кусок будет удалён с диска позже. } for (const DataPartPtr & part : add)