From 912cf7c4eb098a212765e53c326534eaf7b95da9 Mon Sep 17 00:00:00 2001 From: Michael Kolupaev Date: Wed, 28 Nov 2012 17:17:17 +0000 Subject: [PATCH] Merge --- dbms/include/DB/Storages/StorageMergeTree.h | 2 +- dbms/src/Storages/StorageMergeTree.cpp | 5 +---- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/dbms/include/DB/Storages/StorageMergeTree.h b/dbms/include/DB/Storages/StorageMergeTree.h index 92b782378dd..9db9dd5481f 100644 --- a/dbms/include/DB/Storages/StorageMergeTree.h +++ b/dbms/include/DB/Storages/StorageMergeTree.h @@ -151,7 +151,7 @@ private: /// Описание куска с данными. struct DataPart { - DataPart(StorageMergeTree & storage_) : storage(storage_) {} + DataPart(StorageMergeTree & storage_) : storage(storage_), currently_merging(false) {} StorageMergeTree & storage; Yandex::DayNum_t left_date; diff --git a/dbms/src/Storages/StorageMergeTree.cpp b/dbms/src/Storages/StorageMergeTree.cpp index 38817043500..6bfb114a6b4 100644 --- a/dbms/src/Storages/StorageMergeTree.cpp +++ b/dbms/src/Storages/StorageMergeTree.cpp @@ -1234,7 +1234,7 @@ void StorageMergeTree::merge(size_t iterations, bool async) iterations = settings.merging_threads; } - for (size_t i = 0; i < settings.merging_threads; ++i) + for (size_t i = 0; i < iterations; ++i) merge_threads->schedule(boost::bind(&StorageMergeTree::mergeThread, this, while_can)); if (!async) @@ -1246,9 +1246,6 @@ void StorageMergeTree::mergeThread(bool while_can) { try { - DataPartPtr left; - DataPartPtr right; - std::vector parts; while (selectPartsToMerge(parts)) {