From 31a26cdd8900471c1bc9a934e8d4c16d06f611a3 Mon Sep 17 00:00:00 2001 From: Louis Williams Date: Tue, 26 Mar 2019 16:10:05 -0400 Subject: SERVER-40227 Pass ignore prepare behavior from a command attribute rather than using a whitelist --- src/mongo/embedded/service_entry_point_embedded.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/mongo/embedded/service_entry_point_embedded.cpp') 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); } -- cgit v1.2.1