From de764d8be4e1d4fded08b4865465f1a7d4f3366d Mon Sep 17 00:00:00 2001 From: vdimir Date: Tue, 25 May 2021 14:11:20 +0300 Subject: [PATCH 1/2] Log file name on error in FileChecker ctor --- src/Common/FileChecker.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/Common/FileChecker.cpp b/src/Common/FileChecker.cpp index e7fcc8cadb7..173c4bd8a3a 100644 --- a/src/Common/FileChecker.cpp +++ b/src/Common/FileChecker.cpp @@ -21,7 +21,15 @@ namespace ErrorCodes FileChecker::FileChecker(DiskPtr disk_, const String & file_info_path_) : disk(std::move(disk_)) { setPath(file_info_path_); - load(); + try + { + load(); + } + catch (DB::Exception & e) + { + e.addMessage("Error loading file {}", files_info_path); + throw; + } } void FileChecker::setPath(const String & file_info_path_) From 8e192bef55396fc27c2507de41b40a369a418ffb Mon Sep 17 00:00:00 2001 From: Maksim Kita Date: Fri, 28 May 2021 20:22:17 +0300 Subject: [PATCH 2/2] MemoryTracker enable throw logical error --- src/Common/MemoryTracker.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Common/MemoryTracker.cpp b/src/Common/MemoryTracker.cpp index e9ad40075e6..a05fa3b5ad5 100644 --- a/src/Common/MemoryTracker.cpp +++ b/src/Common/MemoryTracker.cpp @@ -173,7 +173,7 @@ void MemoryTracker::allocImpl(Int64 size, bool throw_if_memory_exceeded) } #ifdef MEMORY_TRACKER_DEBUG_CHECKS - if (unlikely(_memory_tracker_always_throw_logical_error_on_allocation) && throw_if_memory_exceeded) + if (unlikely(_memory_tracker_always_throw_logical_error_on_allocation)) { _memory_tracker_always_throw_logical_error_on_allocation = false; throw DB::Exception(DB::ErrorCodes::LOGICAL_ERROR, "Memory tracker: allocations not allowed.");