mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-10 09:32:06 +00:00
check if storage shutdown before we operate MergeTreeDeduplicationLog
This commit is contained in:
parent
5f767b0dfa
commit
dccbe875d2
@ -10,6 +10,8 @@
|
||||
#include <Disks/WriteMode.h>
|
||||
#include <Disks/IDisk.h>
|
||||
|
||||
#include <Common/logger_useful.h>
|
||||
|
||||
namespace DB
|
||||
{
|
||||
|
||||
@ -231,6 +233,12 @@ std::pair<MergeTreePartInfo, bool> MergeTreeDeduplicationLog::addPart(const std:
|
||||
return std::make_pair(info, false);
|
||||
}
|
||||
|
||||
if (stopped)
|
||||
{
|
||||
LOG_ERROR(&Poco::Logger::get("MergeTreeDeduplicationLog"), "Storage has been shutdown when we add this part.");
|
||||
return {};
|
||||
}
|
||||
|
||||
chassert(current_writer != nullptr);
|
||||
|
||||
/// Create new record
|
||||
@ -261,6 +269,12 @@ void MergeTreeDeduplicationLog::dropPart(const MergeTreePartInfo & drop_part_inf
|
||||
if (deduplication_window == 0)
|
||||
return;
|
||||
|
||||
if (stopped)
|
||||
{
|
||||
LOG_ERROR(&Poco::Logger::get("MergeTreeDeduplicationLog"), "Storage has been shutdown when we drop this part.");
|
||||
return;
|
||||
}
|
||||
|
||||
chassert(current_writer != nullptr);
|
||||
|
||||
for (auto itr = deduplication_map.begin(); itr != deduplication_map.end(); /* no increment here, we erasing from map */)
|
||||
|
Loading…
Reference in New Issue
Block a user