summaryrefslogtreecommitdiff
path: root/src/mongo/db/write_concern.cpp
diff options
context:
space:
mode:
authorEliot Horowitz <eliot@10gen.com>2014-10-31 11:30:05 -0400
committerEliot Horowitz <eliot@10gen.com>2014-10-31 17:24:47 -0400
commit6d9669ff5eb235381c27f465b67aa83cd900c000 (patch)
tree75935085473423175e36df24cc13f31dbc41db25 /src/mongo/db/write_concern.cpp
parent57232ccd7c7a326ee7f72f06d2ec61bb8065b7ce (diff)
downloadmongo-6d9669ff5eb235381c27f465b67aa83cd900c000.tar.gz
SERVER-13635: add isDurable to StorageEngine and use for GLE
Diffstat (limited to 'src/mongo/db/write_concern.cpp')
-rw-r--r--src/mongo/db/write_concern.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/mongo/db/write_concern.cpp b/src/mongo/db/write_concern.cpp
index 2afba664721..48a23a1807f 100644
--- a/src/mongo/db/write_concern.cpp
+++ b/src/mongo/db/write_concern.cpp
@@ -37,7 +37,6 @@
#include "mongo/db/repl/repl_coordinator_global.h"
#include "mongo/db/server_options.h"
#include "mongo/db/stats/timer_stats.h"
-#include "mongo/db/storage/mmap_v1/dur.h"
#include "mongo/db/storage/storage_engine.h"
#include "mongo/db/write_concern_options.h"
@@ -52,7 +51,7 @@ namespace mongo {
&gleWtimeouts );
Status validateWriteConcern( const WriteConcernOptions& writeConcern ) {
- const bool isJournalEnabled = getDur().isDurable();
+ const bool isJournalEnabled = getGlobalEnvironment()->getGlobalStorageEngine()->isDurable();
if ( writeConcern.syncMode == WriteConcernOptions::JOURNAL && !isJournalEnabled ) {
return Status( ErrorCodes::BadValue,
@@ -153,9 +152,9 @@ namespace mongo {
switch( writeConcern.syncMode ) {
case WriteConcernOptions::NONE:
break;
- case WriteConcernOptions::FSYNC:
- if ( !getDur().isDurable() ) {
- StorageEngine* storageEngine = getGlobalEnvironment()->getGlobalStorageEngine();
+ case WriteConcernOptions::FSYNC: {
+ StorageEngine* storageEngine = getGlobalEnvironment()->getGlobalStorageEngine();
+ if ( !storageEngine->isDurable() ) {
result->fsyncFiles = storageEngine->flushAllFiles( true );
}
else {
@@ -163,6 +162,7 @@ namespace mongo {
txn->recoveryUnit()->awaitCommit();
}
break;
+ }
case WriteConcernOptions::JOURNAL:
txn->recoveryUnit()->awaitCommit();
break;