summaryrefslogtreecommitdiff
path: root/src/mongo/db/write_concern.cpp
diff options
context:
space:
mode:
authorSpencer T Brody <spencer@mongodb.com>2016-11-16 18:00:03 -0500
committerSpencer T Brody <spencer@mongodb.com>2016-11-17 16:15:50 -0500
commit8347e322cd46e8ee847e1730a7e94ea8e3981c53 (patch)
treebe83dbb5d51b2742c25e2a522ed9313b63dbb668 /src/mongo/db/write_concern.cpp
parentf948e73df5148039b2fc8643a14635d9d982be7a (diff)
downloadmongo-8347e322cd46e8ee847e1730a7e94ea8e3981c53.tar.gz
SERVER-27053 Don't acknowledge writes if the term has changed.
Diffstat (limited to 'src/mongo/db/write_concern.cpp')
-rw-r--r--src/mongo/db/write_concern.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/mongo/db/write_concern.cpp b/src/mongo/db/write_concern.cpp
index 1548dae14a2..f4a30f917f5 100644
--- a/src/mongo/db/write_concern.cpp
+++ b/src/mongo/db/write_concern.cpp
@@ -45,6 +45,7 @@
#include "mongo/db/storage/storage_engine.h"
#include "mongo/db/write_concern_options.h"
#include "mongo/rpc/protocol.h"
+#include "mongo/util/fail_point_service.h"
#include "mongo/util/log.h"
namespace mongo {
@@ -59,6 +60,8 @@ static Counter64 gleWtimeouts;
static ServerStatusMetricField<Counter64> gleWtimeoutsDisplay("getLastError.wtimeouts",
&gleWtimeouts);
+MONGO_FP_DECLARE(hangBeforeWaitingForWriteConcern);
+
StatusWith<WriteConcernOptions> extractWriteConcern(OperationContext* txn,
const BSONObj& cmdObj,
const std::string& dbName,
@@ -182,6 +185,8 @@ Status waitForWriteConcern(OperationContext* txn,
<< ", write concern: " << writeConcern.toBSON();
auto replCoord = repl::ReplicationCoordinator::get(txn);
+ MONGO_FAIL_POINT_PAUSE_WHILE_SET(hangBeforeWaitingForWriteConcern);
+
// Next handle blocking on disk
Timer syncTimer;
WriteConcernOptions writeConcernWithPopulatedSyncMode =