diff options
author | Xiangyu Yao <xiangyu.yao@mongodb.com> | 2018-03-07 15:10:10 -0500 |
---|---|---|
committer | Xiangyu Yao <xiangyu.yao@mongodb.com> | 2018-03-09 18:06:06 -0500 |
commit | 4ef0fe789ef349307c4cffd6548dc8657059cca5 (patch) | |
tree | d13f1dd19a97ca4e9a1e082f566bb0d59cee3147 /src/mongo/db/read_concern.cpp | |
parent | ed1e2b4d2a4987e3744484f9482fdc7a0e119e94 (diff) | |
download | mongo-4ef0fe789ef349307c4cffd6548dc8657059cca5.tar.gz |
SERVER-33609 Pass readConcernLevel to WiredTigerRecoveryUnit
Diffstat (limited to 'src/mongo/db/read_concern.cpp')
-rw-r--r-- | src/mongo/db/read_concern.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/mongo/db/read_concern.cpp b/src/mongo/db/read_concern.cpp index 7c054469bd5..4e8c04440f8 100644 --- a/src/mongo/db/read_concern.cpp +++ b/src/mongo/db/read_concern.cpp @@ -207,6 +207,9 @@ Status waitForReadConcern(OperationContext* opCtx, repl::ReplicationCoordinator* const replCoord = repl::ReplicationCoordinator::get(opCtx); invariant(replCoord); + opCtx->recoveryUnit()->setReadConcernLevelAndReplicationMode(readConcernArgs.getLevel(), + replCoord->getReplicationMode()); + if (readConcernArgs.getLevel() == repl::ReadConcernLevel::kLinearizableReadConcern) { if (replCoord->getReplicationMode() != repl::ReplicationCoordinator::modeReplSet) { // For master/slave and standalone nodes, Linearizable Read is not supported. @@ -299,13 +302,13 @@ Status waitForReadConcern(OperationContext* opCtx, LOG(debugLevel) << "Waiting for 'committed' snapshot to be available for reading: " << readConcernArgs; - Status status = opCtx->recoveryUnit()->setReadFromMajorityCommittedSnapshot(); + Status status = opCtx->recoveryUnit()->obtainMajorityCommittedSnapshot(); // Wait until a snapshot is available. while (status == ErrorCodes::ReadConcernMajorityNotAvailableYet) { LOG(debugLevel) << "Snapshot not available yet."; replCoord->waitUntilSnapshotCommitted(opCtx, Timestamp()); - status = opCtx->recoveryUnit()->setReadFromMajorityCommittedSnapshot(); + status = opCtx->recoveryUnit()->obtainMajorityCommittedSnapshot(); } if (!status.isOK()) { |