diff options
author | Eric Milkie <milkie@10gen.com> | 2014-12-18 10:03:13 -0500 |
---|---|---|
committer | Eric Milkie <milkie@10gen.com> | 2014-12-18 10:10:34 -0500 |
commit | 723f3081a517ddfc3794c6ee4e8edd5946c86044 (patch) | |
tree | 1142270a768b8697bb30ed5f3bcd5ea36fc218e2 /src/mongo/db/storage/wiredtiger | |
parent | bfaa98729f41d02a0aafe1efc44b2074e3d7ba14 (diff) | |
download | mongo-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.cpp | 21 |
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(); } |