diff options
Diffstat (limited to 'src/mongo/db/storage/wiredtiger/wiredtiger_kv_engine.cpp')
-rw-r--r-- | src/mongo/db/storage/wiredtiger/wiredtiger_kv_engine.cpp | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/src/mongo/db/storage/wiredtiger/wiredtiger_kv_engine.cpp b/src/mongo/db/storage/wiredtiger/wiredtiger_kv_engine.cpp index ca750c49f1b..3a4fc015900 100644 --- a/src/mongo/db/storage/wiredtiger/wiredtiger_kv_engine.cpp +++ b/src/mongo/db/storage/wiredtiger/wiredtiger_kv_engine.cpp @@ -690,15 +690,10 @@ WiredTigerKVEngine::WiredTigerKVEngine(const std::string& canonicalName, ss << "verbose=[recovery_progress,checkpoint_progress,compact_progress],"; } - if (kDebugBuild) { - // Enable debug write-ahead logging for all tables under debug build. - ss << "debug_mode=(table_logging=true,"; + if (kDebugBuild && gWiredTigerEvictionDebugMode) { // For select debug builds, support enabling WiredTiger eviction debug mode. This uses // more aggressive eviction tactics, but may have a negative performance impact. - if (gWiredTigerEvictionDebugMode) { - ss << "eviction=true,"; - } - ss << "),"; + ss << "debug_mode=(eviction=true),"; } if (kAddressSanitizerEnabled) { // For applications using WT, advancing a cursor invalidates the data/memory that cursor was @@ -717,6 +712,15 @@ WiredTigerKVEngine::WiredTigerKVEngine(const std::string& canonicalName, ss << "debug_mode=(cursor_copy=true),"; } + if (TestingProctor::instance().isEnabled()) { + // Enable debug write-ahead logging for all tables when testing is enabled. + // + // If MongoDB startup fails, there may be clues from the previous run still left in the WT + // log files that can provide some insight into how the system got into a bad state. When + // testing is enabled, keep around some of these files for investigative purposes. + ss << "debug_mode=(table_logging=true,checkpoint_retention=4),"; + } + ss << WiredTigerCustomizationHooks::get(getGlobalServiceContext()) ->getTableCreateConfig("system"); ss << WiredTigerExtensions::get(getGlobalServiceContext())->getOpenExtensionsConfig(); |