Skip to content

Commit abe14f3

Browse files
committed
rmv from system.exports
1 parent 55e7b94 commit abe14f3

File tree

3 files changed

+12
-0
lines changed

3 files changed

+12
-0
lines changed

src/Storages/MergeTree/ExportList.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,4 +63,12 @@ UInt64 ExportsListElement::getPeakMemoryUsage() const
6363
return thread_group->memory_tracker.getPeak();
6464
}
6565

66+
void ExportsList::remove(const StorageID & source_table_id, const StorageID & destination_table_id, const String & part_name)
67+
{
68+
std::erase_if(entries, [source_table_id, destination_table_id, part_name](const auto & entry)
69+
{
70+
return entry.source_table_id == source_table_id && entry.destination_table_id == destination_table_id && entry.part_name == part_name;
71+
});
72+
}
73+
6674
}

src/Storages/MergeTree/ExportList.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,8 @@ class ExportsList final : public BackgroundProcessList<ExportsListElement, Expor
8383
ExportsList()
8484
: Parent(CurrentMetrics::Export)
8585
{}
86+
87+
void remove(const StorageID & source_table_id, const StorageID & destination_table_id, const String & part_name);
8688
};
8789

8890
using ExportsListEntry = BackgroundProcessListEntry<ExportsListElement, ExportInfo>;

src/Storages/MergeTree/MergeTreeData.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6458,6 +6458,8 @@ void MergeTreeData::killExportPart(const String & query_id)
64586458
{
64596459
if (manifest.task)
64606460
manifest.task->cancel();
6461+
6462+
getContext()->getExportsList().remove(getStorageID(), manifest.destination_storage_id, manifest.data_part->name);
64616463
return true;
64626464
}
64636465
return false;

0 commit comments

Comments
 (0)