Skip to content

Commit 8b8535b

Browse files
authored
Merge pull request #1167 from Altinity/export_replicated_mt_partition_v2
Cleanup export manifests - attempt to prevent crash
2 parents 807c012 + 6a99acf commit 8b8535b

File tree

2 files changed

+16
-0
lines changed

2 files changed

+16
-0
lines changed

src/Storages/StorageMergeTree.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -256,6 +256,11 @@ void StorageMergeTree::shutdown(bool)
256256

257257
if (deduplication_log)
258258
deduplication_log->shutdown();
259+
260+
{
261+
std::lock_guard lock(export_manifests_mutex);
262+
export_manifests.clear();
263+
}
259264
}
260265

261266

src/Storages/StorageReplicatedMergeTree.cpp

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6014,6 +6014,17 @@ void StorageReplicatedMergeTree::shutdown(bool)
60146014
/// Wait for all of them
60156015
std::lock_guard lock(data_parts_exchange_ptr->rwlock);
60166016
}
6017+
6018+
{
6019+
std::lock_guard lock(export_merge_tree_partition_mutex);
6020+
export_merge_tree_partition_task_entries.clear();
6021+
}
6022+
6023+
{
6024+
std::lock_guard lock(export_manifests_mutex);
6025+
export_manifests.clear();
6026+
}
6027+
60176028
LOG_TRACE(log, "Shutdown finished");
60186029
}
60196030

0 commit comments

Comments
 (0)