summaryrefslogtreecommitdiff
path: root/src/mongo/db/storage/wiredtiger
diff options
context:
space:
mode:
authorEric Milkie <milkie@10gen.com>2014-12-18 10:03:13 -0500
committerEric Milkie <milkie@10gen.com>2014-12-18 10:10:34 -0500
commit723f3081a517ddfc3794c6ee4e8edd5946c86044 (patch)
tree1142270a768b8697bb30ed5f3bcd5ea36fc218e2 /src/mongo/db/storage/wiredtiger
parentbfaa98729f41d02a0aafe1efc44b2074e3d7ba14 (diff)
downloadmongo-723f3081a517ddfc3794c6ee4e8edd5946c86044.tar.gz
SERVER-16313 make override of checkpointDelaySecs with syncdelay work properly
Diffstat (limited to 'src/mongo/db/storage/wiredtiger')
-rw-r--r--src/mongo/db/storage/wiredtiger/wiredtiger_options_init.cpp21
1 files changed, 13 insertions, 8 deletions
diff --git a/src/mongo/db/storage/wiredtiger/wiredtiger_options_init.cpp b/src/mongo/db/storage/wiredtiger/wiredtiger_options_init.cpp
index e72c08ce231..db02d9f1951 100644
--- a/src/mongo/db/storage/wiredtiger/wiredtiger_options_init.cpp
+++ b/src/mongo/db/storage/wiredtiger/wiredtiger_options_init.cpp
@@ -43,14 +43,19 @@ namespace mongo {
// Make --syncdelay (syncPeriodSecs in mmapv1) an alias for checkpointDelaySecs in WT
moe::Value syncdelayVal;
- if (moe::startupOptionsParsed.get("storage.mmapv1.syncPeriodSecs", &syncdelayVal).isOK()) {
- // syncdelay is a double but checkpointDelaySecs is an int.
- moe::Value newVal(static_cast<int>(syncdelayVal.as<double>()));
- Status ret = moe::startupOptionsParsed.set(
- "storage.wiredTiger.engineConfig.checkpointDelaySecs", newVal);
- if (!ret.isOK()) {
- return ret;
- }
+ // syncPeriodSecs is always set since it has a default.
+ invariant(moe::startupOptionsParsed.get("storage.mmapv1.syncPeriodSecs",
+ &syncdelayVal).isOK());
+ // Ignore override if set to default of 60.
+ if (syncdelayVal.equal(moe::Value(60.0))) {
+ return Status::OK();
+ }
+ // syncdelay is a double but checkpointDelaySecs is an int.
+ moe::Value newVal(static_cast<int>(syncdelayVal.as<double>()));
+ Status ret = moe::startupOptionsParsed.set(
+ "storage.wiredTiger.engineConfig.checkpointDelaySecs", newVal);
+ if (!ret.isOK()) {
+ return ret;
}
return Status::OK();
}