diff options
author | Samy Lanka <samy.lanka@mongodb.com> | 2019-07-11 10:44:27 -0400 |
---|---|---|
committer | Samy Lanka <samy.lanka@mongodb.com> | 2019-08-08 11:35:32 -0400 |
commit | 77967c90b1a521108c052af235ce7de9742aa95e (patch) | |
tree | 22809f1433ab3b2b3f85359400a36a7d7f8050c4 /src/mongo/db/read_concern_mongod.cpp | |
parent | 321201823455e1c648b7c6bd4ae0a59d1b7115b8 (diff) | |
download | mongo-77967c90b1a521108c052af235ce7de9742aa95e.tar.gz |
SERVER-40466 Unify checks for being in a multi-document transaction
Diffstat (limited to 'src/mongo/db/read_concern_mongod.cpp')
-rw-r--r-- | src/mongo/db/read_concern_mongod.cpp | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/src/mongo/db/read_concern_mongod.cpp b/src/mongo/db/read_concern_mongod.cpp index ea270fef283..b5ce3b2fdb9 100644 --- a/src/mongo/db/read_concern_mongod.cpp +++ b/src/mongo/db/read_concern_mongod.cpp @@ -237,10 +237,9 @@ MONGO_REGISTER_SHIM(waitForReadConcern) ->Status { // 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. We don't want to ignore prepare conflicts because snapshot reads - // should block on prepared transactions. - if (opCtx->getClient()->isInDirectClient() && - readConcernArgs.getLevel() == repl::ReadConcernLevel::kSnapshotReadConcern) { + // waiting for read concern. We don't want to ignore prepare conflicts because reads in + // transactions should block on prepared transactions. + if (opCtx->getClient()->isInDirectClient() && opCtx->inMultiDocumentTransaction()) { return Status::OK(); } |