diff options
author | Daniel Gottlieb <daniel.gottlieb@mongodb.com> | 2021-09-15 15:57:51 +0000 |
---|---|---|
committer | Evergreen Agent <no-reply@evergreen.mongodb.com> | 2021-10-25 17:21:25 +0000 |
commit | 4112456cedfb1f22063929c46305ea77afbfcaec (patch) | |
tree | cc24fa310354a73712cf816abaf9bb940fa3763c | |
parent | 53bf3779928dccbb0abf1e302cf80096b8a63f4a (diff) | |
download | mongo-4112456cedfb1f22063929c46305ea77afbfcaec.tar.gz |
SERVER-58406: Enable WT debug table logging when the test proctor is enabled.
(cherry picked from commit ecc452fcbb203d47ea43f525ac9de8d238312d30)
(cherry picked from commit 10dacddca57e94b8bc7add4e6d3af66844ca57c7)
-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(); |