diff options
author | Eric Milkie <milkie@10gen.com> | 2017-09-27 14:26:59 -0400 |
---|---|---|
committer | Eric Milkie <milkie@10gen.com> | 2017-10-05 16:05:11 -0400 |
commit | 7ef892d32c0507c57eda86ffc591ba5555eb78c6 (patch) | |
tree | de988ac727c32e930efae3fd618a9dc1241f742c /src/mongo/db/read_concern.cpp | |
parent | 08896eec457008f0f09e66bbbdc750ebb6dc6a43 (diff) | |
download | mongo-7ef892d32c0507c57eda86ffc591ba5555eb78c6.tar.gz |
SERVER-30638 change setReadFromMajorityCommittedSnapshot to use timestamps instead of named snapshots
Diffstat (limited to 'src/mongo/db/read_concern.cpp')
-rw-r--r-- | src/mongo/db/read_concern.cpp | 18 |
1 files changed, 4 insertions, 14 deletions
diff --git a/src/mongo/db/read_concern.cpp b/src/mongo/db/read_concern.cpp index 9b034fcb566..79d353f536e 100644 --- a/src/mongo/db/read_concern.cpp +++ b/src/mongo/db/read_concern.cpp @@ -54,14 +54,6 @@ namespace mongo { namespace { -// This is a special flag that allows for testing of snapshot behavior by skipping the replication -// related checks and isolating the storage/query side of snapshotting. -bool testingSnapshotBehaviorInIsolation = false; -ExportedServerParameter<bool, ServerParameterType::kStartupOnly> TestingSnapshotBehaviorInIsolation( - ServerParameterSet::getGlobal(), - "testingSnapshotBehaviorInIsolation", - &testingSnapshotBehaviorInIsolation); - /** * Schedule a write via appendOplogNote command to the primary of this replica set. */ @@ -187,8 +179,7 @@ Status waitForReadConcern(OperationContext* opCtx, const repl::ReadConcernArgs& 39345, opCtx->recoveryUnit()->selectSnapshot(SnapshotName(pointInTime->asTimestamp()))); } - // Skip waiting for the OpTime when testing snapshot behavior - if (!testingSnapshotBehaviorInIsolation && !readConcernArgs.isEmpty()) { + if (!readConcernArgs.isEmpty()) { if (replCoord->isReplEnabled() && afterClusterTime) { auto status = makeNoopWriteIfNeeded(opCtx, *afterClusterTime); if (!status.isOK()) { @@ -204,11 +195,10 @@ Status waitForReadConcern(OperationContext* opCtx, const repl::ReadConcernArgs& } } - if ((replCoord->getReplicationMode() == repl::ReplicationCoordinator::Mode::modeReplSet || - testingSnapshotBehaviorInIsolation) && - readConcernArgs.getLevel() == repl::ReadConcernLevel::kMajorityReadConcern) { + if (readConcernArgs.getLevel() == repl::ReadConcernLevel::kMajorityReadConcern && + replCoord->getReplicationMode() == repl::ReplicationCoordinator::Mode::modeReplSet) { // ReadConcern Majority is not supported in ProtocolVersion 0. - if (!testingSnapshotBehaviorInIsolation && !replCoord->isV1ElectionProtocol()) { + if (!replCoord->isV1ElectionProtocol()) { return {ErrorCodes::ReadConcernMajorityNotEnabled, str::stream() << "Replica sets running protocol version 0 do not support " "readConcern: majority"}; |