summaryrefslogtreecommitdiff
path: root/src/mongo/db/read_concern.cpp
diff options
context:
space:
mode:
authorXiangyu Yao <xiangyu.yao@mongodb.com>2018-03-07 15:10:10 -0500
committerXiangyu Yao <xiangyu.yao@mongodb.com>2018-03-09 18:06:06 -0500
commit4ef0fe789ef349307c4cffd6548dc8657059cca5 (patch)
treed13f1dd19a97ca4e9a1e082f566bb0d59cee3147 /src/mongo/db/read_concern.cpp
parented1e2b4d2a4987e3744484f9482fdc7a0e119e94 (diff)
downloadmongo-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.cpp7
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()) {