summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGregory Wlodarek <gregory.wlodarek@mongodb.com>2020-02-28 14:35:27 -0500
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2020-02-28 20:25:50 +0000
commit4226e47a720fbf861180828e4aa310ff9d9fe166 (patch)
tree57fa188ab0bd661d46cd992654cca7dde47a53bc
parenteb81b49551d3fa7763c1a917bf210e497ef5bab7 (diff)
downloadmongo-4226e47a720fbf861180828e4aa310ff9d9fe166.tar.gz
SERVER-46488 queryableBackupMode should recover from the journal files on startup
-rw-r--r--src/mongo/db/mongod_options.cpp1
-rw-r--r--src/mongo/db/storage/wiredtiger/wiredtiger_kv_engine.cpp39
2 files changed, 19 insertions, 21 deletions
diff --git a/src/mongo/db/mongod_options.cpp b/src/mongo/db/mongod_options.cpp
index 11a75108e9c..3239b911338 100644
--- a/src/mongo/db/mongod_options.cpp
+++ b/src/mongo/db/mongod_options.cpp
@@ -428,7 +428,6 @@ Status storeMongodOptions(const moe::Environment& params) {
if (params.count("storage.queryableBackupMode") &&
params["storage.queryableBackupMode"].as<bool>()) {
storageGlobalParams.readOnly = true;
- storageGlobalParams.dur = false;
}
if (params.count("storage.groupCollections")) {
diff --git a/src/mongo/db/storage/wiredtiger/wiredtiger_kv_engine.cpp b/src/mongo/db/storage/wiredtiger/wiredtiger_kv_engine.cpp
index 505ed8722d9..d09b96c3c2c 100644
--- a/src/mongo/db/storage/wiredtiger/wiredtiger_kv_engine.cpp
+++ b/src/mongo/db/storage/wiredtiger/wiredtiger_kv_engine.cpp
@@ -646,33 +646,32 @@ WiredTigerKVEngine::WiredTigerKVEngine(const std::string& canonicalName,
// The setting may have a later setting override it if not using the journal. We make it
// unconditional here because even nojournal may need this setting if it is a transition
// from using the journal.
- if (!_readOnly) {
- // If we're readOnly skip all WAL-related settings.
- ss << "log=(enabled=true,archive=true,path=journal,compressor=";
- ss << wiredTigerGlobalOptions.journalCompressor << "),";
- ss << "file_manager=(close_idle_time=" << gWiredTigerFileHandleCloseIdleTime
- << ",close_scan_interval=" << gWiredTigerFileHandleCloseScanInterval
- << ",close_handle_minimum=" << gWiredTigerFileHandleCloseMinimum << "),";
- ss << "statistics_log=(wait=" << wiredTigerGlobalOptions.statisticsLogDelaySecs << "),";
-
- if (shouldLog(::mongo::logger::LogComponent::kStorageRecovery,
- logger::LogSeverity::Debug(3))) {
- ss << "verbose=[recovery_progress,checkpoint_progress,recovery],";
- } else {
- ss << "verbose=[recovery_progress,checkpoint_progress],";
- }
+ ss << "log=(enabled=true,archive=" << (_readOnly ? "false" : "true")
+ << ",path=journal,compressor=";
+ ss << wiredTigerGlobalOptions.journalCompressor << "),";
+ ss << "file_manager=(close_idle_time=" << gWiredTigerFileHandleCloseIdleTime
+ << ",close_scan_interval=" << gWiredTigerFileHandleCloseScanInterval
+ << ",close_handle_minimum=" << gWiredTigerFileHandleCloseMinimum << "),";
+ ss << "statistics_log=(wait=" << wiredTigerGlobalOptions.statisticsLogDelaySecs << "),";
+
+ if (shouldLog(::mongo::logger::LogComponent::kStorageRecovery, logger::LogSeverity::Debug(3))) {
+ ss << "verbose=[recovery_progress,checkpoint_progress,recovery],";
+ } else {
+ ss << "verbose=[recovery_progress,checkpoint_progress],";
+ }
- // Enable debug write-ahead logging for all tables under debug build.
- if (kDebugBuild) {
- ss << "debug_mode=(table_logging=true),";
- }
+ // Enable debug write-ahead logging for all tables under debug build.
+ if (kDebugBuild) {
+ ss << "debug_mode=(table_logging=true),";
}
+ ss << "),";
+
ss << WiredTigerCustomizationHooks::get(getGlobalServiceContext())
->getTableCreateConfig("system");
ss << WiredTigerExtensions::get(getGlobalServiceContext())->getOpenExtensionsConfig();
ss << extraOpenOptions;
- if (!_durable && !_readOnly) {
+ if (!_durable) {
// If we started without the journal, but previously used the journal then open with the
// WT log enabled to perform any unclean shutdown recovery and then close and reopen in
// the normal path without the journal.