summaryrefslogtreecommitdiff
path: root/src/mongo/db/read_concern_mongod.cpp
diff options
context:
space:
mode:
authorHenrik Edin <henrik.edin@mongodb.com>2019-02-21 11:14:25 -0500
committerHenrik Edin <henrik.edin@mongodb.com>2019-02-25 10:48:27 -0500
commit2e07e8c0953eedc4b3949b2dc47d289e9db2c183 (patch)
tree0f86362dac93cd4b0929135464361ae2cf55329d /src/mongo/db/read_concern_mongod.cpp
parent505ef87d3519c1ca90a62c408705998786a7b863 (diff)
downloadmongo-2e07e8c0953eedc4b3949b2dc47d289e9db2c183.tar.gz
SERVER-39539 IDL'ify waitForSecondaryBeforeNoopWriteMS server parameter
Diffstat (limited to 'src/mongo/db/read_concern_mongod.cpp')
-rw-r--r--src/mongo/db/read_concern_mongod.cpp25
1 files changed, 11 insertions, 14 deletions
diff --git a/src/mongo/db/read_concern_mongod.cpp b/src/mongo/db/read_concern_mongod.cpp
index d20f4ad7b38..2837d64b29e 100644
--- a/src/mongo/db/read_concern_mongod.cpp
+++ b/src/mongo/db/read_concern_mongod.cpp
@@ -37,11 +37,11 @@
#include "mongo/db/logical_clock.h"
#include "mongo/db/op_observer.h"
#include "mongo/db/operation_context.h"
+#include "mongo/db/read_concern_mongod_gen.h"
#include "mongo/db/repl/repl_client_info.h"
#include "mongo/db/repl/speculative_majority_read_info.h"
#include "mongo/db/s/sharding_state.h"
#include "mongo/db/server_options.h"
-#include "mongo/db/server_parameters.h"
#include "mongo/db/transaction_participant.h"
#include "mongo/s/grid.h"
#include "mongo/util/concurrency/notification.h"
@@ -54,8 +54,8 @@ namespace {
MONGO_FAIL_POINT_DEFINE(hangBeforeLinearizableReadConcern);
/**
-* Synchronize writeRequests
-*/
+ * Synchronize writeRequests
+ */
class WriteRequestSynchronizer;
const auto getWriteRequestsSynchronizer =
@@ -66,10 +66,10 @@ public:
WriteRequestSynchronizer() = default;
/**
- * Returns a tuple <false, existingWriteRequest> if it can find the one that happened after or
- * at clusterTime.
- * Returns a tuple <true, newWriteRequest> otherwise.
- */
+ * Returns a tuple <false, existingWriteRequest> if it can find the one that happened after or
+ * at clusterTime.
+ * Returns a tuple <true, newWriteRequest> otherwise.
+ */
std::tuple<bool, std::shared_ptr<Notification<Status>>> getOrCreateWriteRequest(
LogicalTime clusterTime) {
stdx::unique_lock<stdx::mutex> lock(_mutex);
@@ -84,8 +84,8 @@ public:
}
/**
- * Erases writeRequest that happened at clusterTime
- */
+ * Erases writeRequest that happened at clusterTime
+ */
void deleteWriteRequest(LogicalTime clusterTime) {
stdx::unique_lock<stdx::mutex> lock(_mutex);
auto el = _writeRequests.find(clusterTime.asTimestamp());
@@ -100,12 +100,9 @@ private:
std::map<Timestamp, std::shared_ptr<Notification<Status>>> _writeRequests;
};
-
-MONGO_EXPORT_SERVER_PARAMETER(waitForSecondaryBeforeNoopWriteMS, int, 10);
-
/**
-* Schedule a write via appendOplogNote command to the primary of this replica set.
-*/
+ * Schedule a write via appendOplogNote command to the primary of this replica set.
+ */
Status makeNoopWriteIfNeeded(OperationContext* opCtx, LogicalTime clusterTime) {
repl::ReplicationCoordinator* const replCoord = repl::ReplicationCoordinator::get(opCtx);
invariant(replCoord->isReplEnabled());