summaryrefslogtreecommitdiff
path: root/src/mongo/db/read_concern_mongod.cpp
diff options
context:
space:
mode:
authorTess Avitabile <tess.avitabile@mongodb.com>2018-10-08 17:11:53 -0400
committerTess Avitabile <tess.avitabile@mongodb.com>2018-10-11 10:18:02 -0400
commitcc99b89e8c2ecbae3b4ae006f0a97927fe6040ce (patch)
treee40ccb87ee101abb0d1b68aac57578a022f09aca /src/mongo/db/read_concern_mongod.cpp
parent2f4b5918497b09a226a3ec5dcff930edd52ea1e9 (diff)
downloadmongo-cc99b89e8c2ecbae3b4ae006f0a97927fe6040ce.tar.gz
SERVER-37514 Snapshot readConcern without atClusterTime should always be speculative
Diffstat (limited to 'src/mongo/db/read_concern_mongod.cpp')
-rw-r--r--src/mongo/db/read_concern_mongod.cpp8
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) {