From d958235ad08e2d4fb5fadf3ff00412dc6bc37083 Mon Sep 17 00:00:00 2001 From: Igor Solodovnikov Date: Sun, 14 Feb 2021 21:13:10 +0200 Subject: [PATCH] PSMDB-810 log more info during hot backup on debug level 2 --- .../db/storage/wiredtiger/wiredtiger_kv_engine.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/mongo/db/storage/wiredtiger/wiredtiger_kv_engine.cpp b/src/mongo/db/storage/wiredtiger/wiredtiger_kv_engine.cpp index 6ca20801c13c5d..4c53d1e230c980 100644 --- a/src/mongo/db/storage/wiredtiger/wiredtiger_kv_engine.cpp +++ b/src/mongo/db/storage/wiredtiger/wiredtiger_kv_engine.cpp @@ -2069,6 +2069,16 @@ Status WiredTigerKVEngine::hotBackup(OperationContext* opCtx, const std::string& fs::path destFile{std::get<1>(file)}; auto fsize{std::get<2>(file)}; + if (MONGO_unlikely(shouldLog(logger::LogSeverity::Debug(2)))) { + LOG(2) << "Hot backup copying {} bytes from '{}' to '{}'"_format( + fsize, srcFile.string(), destFile.string()); + if (!fs::exists(srcFile)) { + LOG(2) << "Source file does not exist: {}"_format(srcFile.string()); + } else { + LOG(2) << "Source file size is: {} bytes"_format(fs::file_size(srcFile)); + } + } + try { // Try creating destination directories if needed. const fs::path destDir(destFile.parent_path());