summaryrefslogtreecommitdiff
path: root/src/mongo/embedded
diff options
context:
space:
mode:
authorLouis Williams <louis.williams@mongodb.com>2019-03-26 16:10:05 -0400
committerLouis Williams <louis.williams@mongodb.com>2019-03-26 16:10:05 -0400
commit31a26cdd8900471c1bc9a934e8d4c16d06f611a3 (patch)
treeb6679fd95dc56e8ae155aef2d58245bc3dbfc24e /src/mongo/embedded
parentaaa404d9d7e56a1d327f72e505f4e67b4a821959 (diff)
downloadmongo-31a26cdd8900471c1bc9a934e8d4c16d06f611a3.tar.gz
SERVER-40227 Pass ignore prepare behavior from a command attribute rather than using a whitelist
Diffstat (limited to 'src/mongo/embedded')
-rw-r--r--src/mongo/embedded/read_concern_embedded.cpp2
-rw-r--r--src/mongo/embedded/service_entry_point_embedded.cpp5
2 files changed, 5 insertions, 2 deletions
diff --git a/src/mongo/embedded/read_concern_embedded.cpp b/src/mongo/embedded/read_concern_embedded.cpp
index baa683c7dfa..f8e367d0b74 100644
--- a/src/mongo/embedded/read_concern_embedded.cpp
+++ b/src/mongo/embedded/read_concern_embedded.cpp
@@ -37,7 +37,7 @@ MONGO_REGISTER_SHIM(waitForReadConcern)
(OperationContext* opCtx,
const repl::ReadConcernArgs& readConcernArgs,
bool allowAfterClusterTime,
- StringData cmdName)
+ PrepareConflictBehavior prepareConflictBehavior)
->Status {
if (readConcernArgs.getLevel() == repl::ReadConcernLevel::kLinearizableReadConcern) {
return {ErrorCodes::NotImplemented, "linearizable read concern not supported on embedded"};
diff --git a/src/mongo/embedded/service_entry_point_embedded.cpp b/src/mongo/embedded/service_entry_point_embedded.cpp
index 6a7c17e5b64..8c19c925ea5 100644
--- a/src/mongo/embedded/service_entry_point_embedded.cpp
+++ b/src/mongo/embedded/service_entry_point_embedded.cpp
@@ -50,10 +50,13 @@ public:
void waitForReadConcern(OperationContext* opCtx,
const CommandInvocation* invocation,
const OpMsgRequest& request) const override {
+ const auto prepareConflictBehavior = invocation->canIgnorePrepareConflicts()
+ ? PrepareConflictBehavior::kIgnore
+ : PrepareConflictBehavior::kEnforce;
auto rcStatus = mongo::waitForReadConcern(opCtx,
repl::ReadConcernArgs::get(opCtx),
invocation->allowsAfterClusterTime(),
- request.getCommandName());
+ prepareConflictBehavior);
uassertStatusOK(rcStatus);
}