diff options
-rw-r--r-- | src/mongo/db/read_concern_mongod.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/mongo/db/read_concern_mongod.cpp b/src/mongo/db/read_concern_mongod.cpp index 5309f3ab747..d36555ab621 100644 --- a/src/mongo/db/read_concern_mongod.cpp +++ b/src/mongo/db/read_concern_mongod.cpp @@ -211,11 +211,13 @@ MONGO_REGISTER_SHIM(waitForReadConcern) repl::ReplicationCoordinator* const replCoord = repl::ReplicationCoordinator::get(opCtx); invariant(replCoord); - // Currently speculative read concern is used only for transactions. However, speculative read - // concern is not yet supported with atClusterTime. + // Currently speculative read concern is used only for transactions (equivalently, when the read + // concern level is 'snapshot'). However, speculative read concern is not yet supported with + // atClusterTime. // // TODO SERVER-34620: Re-enable speculative behavior when "atClusterTime" is specified. - const bool speculative = txnParticipant && txnParticipant->inMultiDocumentTransaction() && + const bool speculative = + readConcernArgs.getLevel() == repl::ReadConcernLevel::kSnapshotReadConcern && !readConcernArgs.getArgsAtClusterTime(); if (readConcernArgs.getLevel() == repl::ReadConcernLevel::kLinearizableReadConcern) { |