From 402e031a22682d0da294f53746c3c1259e0d8607 Mon Sep 17 00:00:00 2001 From: alesapin Date: Thu, 28 Jan 2021 11:07:18 +0300 Subject: [PATCH] Throw exception only in debug mode --- src/Storages/MergeTree/ReplicatedMergeTreePartCheckThread.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/Storages/MergeTree/ReplicatedMergeTreePartCheckThread.cpp b/src/Storages/MergeTree/ReplicatedMergeTreePartCheckThread.cpp index fc762b21046..c9175ad14db 100644 --- a/src/Storages/MergeTree/ReplicatedMergeTreePartCheckThread.cpp +++ b/src/Storages/MergeTree/ReplicatedMergeTreePartCheckThread.cpp @@ -195,7 +195,11 @@ void ReplicatedMergeTreePartCheckThread::searchForMissingPartAndFetchIfPossible( if (!storage.queue.remove(zookeeper, part_name)) { /// The part was not in our queue. Why did it happen? +#ifdef NDEBUG + LOG_ERROR(log, "Missing part {} is not in our queue.", part_name); +#else throw Exception(ErrorCodes::LOGICAL_ERROR, "Missing part {} is not in our queue.", part_name); +#endif } /** This situation is possible if on all the replicas where the part was, it deteriorated.