summaryrefslogtreecommitdiff
path: root/src/mongo/db
diff options
context:
space:
mode:
authorTess Avitabile <tess.avitabile@mongodb.com>2018-05-23 15:05:13 -0400
committerTess Avitabile <tess.avitabile@mongodb.com>2018-05-30 10:21:36 -0400
commitedeb8654ddf4c84e8dd28079c680fd2c83b9df5f (patch)
treeb33ed0905cc6e33187ed967908a2762aee9152e7 /src/mongo/db
parent7af5fcad87805869d2a1b492166b8253992a6898 (diff)
downloadmongo-edeb8654ddf4c84e8dd28079c680fd2c83b9df5f.tar.gz
SERVER-34348 Add causally consistent core_txns passthrough
(cherry picked from commit 16d96f4ef0a11543b2035e58867840a410afdff1)
Diffstat (limited to 'src/mongo/db')
-rw-r--r--src/mongo/db/read_concern.cpp10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/mongo/db/read_concern.cpp b/src/mongo/db/read_concern.cpp
index b604b883cab..c5fade9dcb1 100644
--- a/src/mongo/db/read_concern.cpp
+++ b/src/mongo/db/read_concern.cpp
@@ -205,10 +205,18 @@ Status makeNoopWriteIfNeeded(OperationContext* opCtx, LogicalTime clusterTime) {
Status waitForReadConcern(OperationContext* opCtx,
const repl::ReadConcernArgs& readConcernArgs,
bool allowAfterClusterTime) {
+ // If we are in a direct client within a transaction, then we may be holding locks, so it is
+ // illegal to wait for read concern. This is fine, since the outer operation should have handled
+ // waiting for read concern.
+ auto session = OperationContextSession::get(opCtx);
+ if (opCtx->getClient()->isInDirectClient() && session &&
+ session->inMultiDocumentTransaction()) {
+ return Status::OK();
+ }
+
repl::ReplicationCoordinator* const replCoord = repl::ReplicationCoordinator::get(opCtx);
invariant(replCoord);
- auto session = OperationContextSession::get(opCtx);
// Currently speculative read concern is used only for transactions and snapshot reads. However,
// speculative read concern is not yet supported with atClusterTime.
//