|
49 | 49 | #include "Core/BackgroundSchedulePool.h" |
50 | 50 | #include "Storages/ObjectStorage/MergeTree/ExportPartPlainMergeTreeTask.h" |
51 | 51 | #include <Core/Names.h> |
52 | | -#include <Storages/ObjectStorage/MergeTree/ExportPartitionPlainMergeTreeTask.h> |
53 | 52 | #include <Storages/ObjectStorage/StorageObjectStorage.h> |
54 | 53 | #include <Functions/generateSnowflakeID.h> |
55 | 54 | #include <Storages/ObjectStorage/MergeTree/StorageObjectStorageMergeTreePartImporterSink.h> |
@@ -82,7 +81,6 @@ namespace Setting |
82 | 81 | extern const SettingsBool throw_on_unsupported_query_inside_transaction; |
83 | 82 | extern const SettingsUInt64 max_parts_to_move; |
84 | 83 | extern const SettingsBool allow_experimental_export_merge_tree_partition; |
85 | | - extern const SettingsBool export_merge_tree_partition_executor; |
86 | 84 | } |
87 | 85 |
|
88 | 86 | namespace MergeTreeSetting |
@@ -576,27 +574,10 @@ void StorageMergeTree::exportPartitionToTable(const PartitionCommand & command, |
576 | 574 | export_partition_transaction_id_to_manifest[transaction_id] = manifest; |
577 | 575 | } |
578 | 576 |
|
579 | | - if (!getContext()->getSettingsRef()[Setting::export_merge_tree_partition_executor]) |
| 577 | + for (const auto & part : all_parts) |
580 | 578 | { |
581 | | - for (const auto & part : all_parts) |
582 | | - { |
583 | | - auto tagger = std::make_shared<CurrentlyExportingPartsTagger>(std::vector<DataPartPtr>{part}, *this); |
584 | | - auto task = std::make_shared<ExportPartPlainMergeTreeTask>(*this, tagger, dest_storage, getContext(), manifest, moves_assignee_trigger); |
585 | | - background_moves_assignee.scheduleMoveTask(task); |
586 | | - } |
587 | | - } |
588 | | - else |
589 | | - { |
590 | | - auto exports_tagger = std::make_shared<CurrentlyExportingPartsTagger>(std::move(all_parts), *this); |
591 | | - |
592 | | - auto task = std::make_shared<ExportPartitionPlainMergeTreeTask>( |
593 | | - *this, |
594 | | - exports_tagger, |
595 | | - dest_storage, |
596 | | - getContext(), |
597 | | - manifest, |
598 | | - moves_assignee_trigger); |
599 | | - |
| 579 | + auto tagger = std::make_shared<CurrentlyExportingPartsTagger>(std::vector<DataPartPtr>{part}, *this); |
| 580 | + auto task = std::make_shared<ExportPartPlainMergeTreeTask>(*this, tagger, dest_storage, getContext(), manifest, moves_assignee_trigger); |
600 | 581 | background_moves_assignee.scheduleMoveTask(task); |
601 | 582 | } |
602 | 583 | } |
@@ -1247,33 +1228,12 @@ void StorageMergeTree::resumeExportPartitionTasks() |
1247 | 1228 | parts_to_export.emplace_back(part); |
1248 | 1229 | } |
1249 | 1230 |
|
1250 | | - if (!getContext()->getSettingsRef()[Setting::export_merge_tree_partition_executor]) |
| 1231 | + for (const auto & part : parts_to_export) |
1251 | 1232 | { |
1252 | | - for (const auto & part : parts_to_export) |
1253 | | - { |
1254 | | - auto tagger = std::make_shared<CurrentlyExportingPartsTagger>(std::vector<DataPartPtr>{part}, *this); |
1255 | | - auto task = std::make_shared<ExportPartPlainMergeTreeTask>(*this, tagger, destination_storage, getContext(), manifest, moves_assignee_trigger); |
1256 | | - background_moves_assignee.scheduleMoveTask(task); |
1257 | | - } |
1258 | | - } |
1259 | | - else |
1260 | | - { |
1261 | | - /// TODO: this locks the parts that have not been exported yet. Should we also lock the already exported parts as well? |
1262 | | - /// There is some inconsistency with in-progress exports. The parts will not be unlocked until all parts have been exported OR a re-start happens |
1263 | | - /// I just checked and mutations handle it slightly different. Tagger will actually contain a single part, which is released as soon as it finishes. |
1264 | | - auto exports_tagger = std::make_shared<CurrentlyExportingPartsTagger>(std::move(parts_to_export), *this); |
1265 | | - |
1266 | | - auto task = std::make_shared<ExportPartitionPlainMergeTreeTask>( |
1267 | | - *this, |
1268 | | - exports_tagger, |
1269 | | - destination_storage, |
1270 | | - getContext(), |
1271 | | - manifest, |
1272 | | - moves_assignee_trigger); |
1273 | | - |
| 1233 | + auto tagger = std::make_shared<CurrentlyExportingPartsTagger>(std::vector<DataPartPtr>{part}, *this); |
| 1234 | + auto task = std::make_shared<ExportPartPlainMergeTreeTask>(*this, tagger, destination_storage, getContext(), manifest, moves_assignee_trigger); |
1274 | 1235 | background_moves_assignee.scheduleMoveTask(task); |
1275 | 1236 | } |
1276 | | - |
1277 | 1237 | } |
1278 | 1238 | } |
1279 | 1239 |
|
|
0 commit comments