summaryrefslogtreecommitdiff
path: root/src/mongo/db
diff options
context:
space:
mode:
authormatt dannenberg <matt.dannenberg@10gen.com>2015-07-14 08:58:21 -0400
committermatt dannenberg <matt.dannenberg@10gen.com>2015-07-19 12:31:09 -0400
commit92c6ee5cedf09928720b79592981dc1c6aeb0482 (patch)
treeb432767326684c1d6164cc2204eb47ec6e5b2869 /src/mongo/db
parent3b758994b8922dc99aa891d0b6c5a5ddcbc91307 (diff)
downloadmongo-92c6ee5cedf09928720b79592981dc1c6aeb0482.tar.gz
SERVER-19207 SERVER-19210 committed reads wait for a committed snapshot and read committed ignored on masterslave and standalone
Diffstat (limited to 'src/mongo/db')
-rw-r--r--src/mongo/db/commands.h12
-rw-r--r--src/mongo/db/commands/count_cmd.cpp2
-rw-r--r--src/mongo/db/commands/distinct.cpp2
-rw-r--r--src/mongo/db/commands/explain_cmd.h2
-rw-r--r--src/mongo/db/commands/find_cmd.cpp2
-rw-r--r--src/mongo/db/commands/geo_near_cmd.cpp2
-rw-r--r--src/mongo/db/commands/getmore_cmd.cpp2
-rw-r--r--src/mongo/db/commands/group.h2
-rw-r--r--src/mongo/db/commands/mr.cpp2
-rw-r--r--src/mongo/db/commands/parallel_collection_scan.cpp2
-rw-r--r--src/mongo/db/commands/pipeline_command.cpp2
-rw-r--r--src/mongo/db/dbcommands.cpp86
-rw-r--r--src/mongo/db/geo/haystack.cpp2
-rw-r--r--src/mongo/db/repl/oplog.cpp11
-rw-r--r--src/mongo/db/repl/read_concern_args.cpp3
-rw-r--r--src/mongo/db/repl/read_concern_args.h6
-rw-r--r--src/mongo/db/repl/replication_coordinator_impl.cpp14
-rw-r--r--src/mongo/db/repl/replication_coordinator_impl_test.cpp30
-rw-r--r--src/mongo/db/storage/recovery_unit.h8
-rw-r--r--src/mongo/db/storage/wiredtiger/wiredtiger_recovery_unit.cpp4
-rw-r--r--src/mongo/db/storage/wiredtiger/wiredtiger_snapshot_manager.cpp2
21 files changed, 126 insertions, 72 deletions
diff --git a/src/mongo/db/commands.h b/src/mongo/db/commands.h
index 6ad97610b9d..2f25a87719a 100644
--- a/src/mongo/db/commands.h
+++ b/src/mongo/db/commands.h
@@ -216,18 +216,18 @@ public:
}
/**
- * Returns true if this Command supports the $readMajorityTemporaryName argument.
+ * Returns true if this Command supports the readConcern argument.
*
- * If the $readMajorityTemporaryName argument is sent to a command that returns false the
- * command processor will reject the command, returning an appropriate error message. For
- * commands that support the argument, the command processor will instruct the RecoveryUnit
- * to only return "committed" data, failing if this isn't supported by the storage engine.
+ * If the readConcern argument is sent to a command that returns false the command processor
+ * will reject the command, returning an appropriate error message. For commands that support
+ * the argument, the command processor will instruct the RecoveryUnit to only return
+ * "committed" data, failing if this isn't supported by the storage engine.
*
* Note that this is never called on mongos. Sharded commands are responsible for forwarding
* the option to the shards as needed. We rely on the shards to fail the commands in the
* cases where it isn't supported.
*/
- virtual bool supportsReadMajority() const {
+ virtual bool supportsReadConcern() const {
return false;
}
diff --git a/src/mongo/db/commands/count_cmd.cpp b/src/mongo/db/commands/count_cmd.cpp
index 2ab9d1baed5..4f79e44e04d 100644
--- a/src/mongo/db/commands/count_cmd.cpp
+++ b/src/mongo/db/commands/count_cmd.cpp
@@ -70,7 +70,7 @@ public:
virtual bool adminOnly() const {
return false;
}
- bool supportsReadMajority() const final {
+ bool supportsReadConcern() const final {
return true;
}
virtual void help(stringstream& help) const {
diff --git a/src/mongo/db/commands/distinct.cpp b/src/mongo/db/commands/distinct.cpp
index 3497b793bc2..b8ddc404d40 100644
--- a/src/mongo/db/commands/distinct.cpp
+++ b/src/mongo/db/commands/distinct.cpp
@@ -64,7 +64,7 @@ public:
virtual bool isWriteCommandForConfigServer() const {
return false;
}
- bool supportsReadMajority() const final {
+ bool supportsReadConcern() const final {
return true;
}
diff --git a/src/mongo/db/commands/explain_cmd.h b/src/mongo/db/commands/explain_cmd.h
index 9ff993664ef..13c9a29673a 100644
--- a/src/mongo/db/commands/explain_cmd.h
+++ b/src/mongo/db/commands/explain_cmd.h
@@ -71,7 +71,7 @@ public:
return false;
}
- bool supportsReadMajority() const final {
+ bool supportsReadConcern() const final {
return true;
}
diff --git a/src/mongo/db/commands/find_cmd.cpp b/src/mongo/db/commands/find_cmd.cpp
index 36d9e6f4f82..eac7ec1746e 100644
--- a/src/mongo/db/commands/find_cmd.cpp
+++ b/src/mongo/db/commands/find_cmd.cpp
@@ -85,7 +85,7 @@ public:
return false;
}
- bool supportsReadMajority() const final {
+ bool supportsReadConcern() const final {
return true;
}
diff --git a/src/mongo/db/commands/geo_near_cmd.cpp b/src/mongo/db/commands/geo_near_cmd.cpp
index ec8bf54513d..8f03f059d80 100644
--- a/src/mongo/db/commands/geo_near_cmd.cpp
+++ b/src/mongo/db/commands/geo_near_cmd.cpp
@@ -69,7 +69,7 @@ public:
bool slaveOverrideOk() const {
return true;
}
- bool supportsReadMajority() const final {
+ bool supportsReadConcern() const final {
return true;
}
diff --git a/src/mongo/db/commands/getmore_cmd.cpp b/src/mongo/db/commands/getmore_cmd.cpp
index 06a2d14b97d..233a98a6d50 100644
--- a/src/mongo/db/commands/getmore_cmd.cpp
+++ b/src/mongo/db/commands/getmore_cmd.cpp
@@ -95,7 +95,7 @@ public:
return false;
}
- bool supportsReadMajority() const final {
+ bool supportsReadConcern() const final {
// Uses the $readMajorityTemporaryName setting from whatever created the cursor.
return false;
}
diff --git a/src/mongo/db/commands/group.h b/src/mongo/db/commands/group.h
index d6d0ea7b338..9f06063c4b9 100644
--- a/src/mongo/db/commands/group.h
+++ b/src/mongo/db/commands/group.h
@@ -61,7 +61,7 @@ private:
return true;
}
- bool supportsReadMajority() const final {
+ bool supportsReadConcern() const final {
return true;
}
diff --git a/src/mongo/db/commands/mr.cpp b/src/mongo/db/commands/mr.cpp
index c275157e762..bfcb529e6d7 100644
--- a/src/mongo/db/commands/mr.cpp
+++ b/src/mongo/db/commands/mr.cpp
@@ -1237,7 +1237,7 @@ public:
return true;
}
- bool supportsReadMajority() const final {
+ bool supportsReadConcern() const final {
return true;
}
diff --git a/src/mongo/db/commands/parallel_collection_scan.cpp b/src/mongo/db/commands/parallel_collection_scan.cpp
index 351fc4f7711..e6754efde12 100644
--- a/src/mongo/db/commands/parallel_collection_scan.cpp
+++ b/src/mongo/db/commands/parallel_collection_scan.cpp
@@ -66,7 +66,7 @@ public:
return true;
}
- bool supportsReadMajority() const final {
+ bool supportsReadConcern() const final {
return true;
}
diff --git a/src/mongo/db/commands/pipeline_command.cpp b/src/mongo/db/commands/pipeline_command.cpp
index 9d971447dd9..d559d8c3b3f 100644
--- a/src/mongo/db/commands/pipeline_command.cpp
+++ b/src/mongo/db/commands/pipeline_command.cpp
@@ -157,7 +157,7 @@ public:
virtual bool slaveOverrideOk() const {
return true;
}
- bool supportsReadMajority() const final {
+ bool supportsReadConcern() const final {
return true;
}
virtual void help(stringstream& help) const {
diff --git a/src/mongo/db/dbcommands.cpp b/src/mongo/db/dbcommands.cpp
index 61f57fc6283..447bc922943 100644
--- a/src/mongo/db/dbcommands.cpp
+++ b/src/mongo/db/dbcommands.cpp
@@ -1164,34 +1164,14 @@ void Command::execCommand(OperationContext* txn,
return;
}
- if (request.getCommandArgs()["$readMajorityTemporaryName"].trueValue()) {
- if (!command->supportsReadMajority()) {
- replyBuilder->setMetadata(rpc::makeEmptyMetadata())
- .setCommandReply({ErrorCodes::InvalidOptions,
- str::stream()
- << "Command " << command->name
- << " does not support $readMajorityTemporaryName"});
- return;
- }
-
- // TODO SERVER-19210 we should only do this if running in a replica set.
- Status status = txn->recoveryUnit()->setReadFromMajorityCommittedSnapshot();
- if (!status.isOK()) {
- // TODO SERVER-19207 if code is XXX_TEMP_NAME_ReadCommittedCurrentlyUnavailable,
- // block until a committed snapshot is available.
- replyBuilder->setMetadata(rpc::makeEmptyMetadata()).setCommandReply(status);
- return;
- }
- }
-
+ repl::ReplicationCoordinator* replCoord =
+ repl::ReplicationCoordinator::get(txn->getClient()->getServiceContext());
ImpersonationSessionGuard guard(txn);
uassertStatusOK(
_checkAuthorization(command, txn->getClient(), dbname, request.getCommandArgs()));
{
- repl::ReplicationCoordinator* replCoord = repl::getGlobalReplicationCoordinator();
-
bool iAmPrimary = replCoord->canAcceptWritesForDatabase(dbname);
bool commandCanRunOnSecondary = command->slaveOk();
@@ -1276,22 +1256,62 @@ bool Command::run(OperationContext* txn,
BSONObjBuilder replyBuilderBob;
repl::ReplicationCoordinator* replCoord = repl::getGlobalReplicationCoordinator();
+
{
- // Handle read after opTime.
- repl::ReadConcernArgs readAfterOptimeSettings;
- auto readAfterParseStatus = readAfterOptimeSettings.initialize(request.getCommandArgs());
- if (!readAfterParseStatus.isOK()) {
+ // parse and validate ReadConcernArgs
+ repl::ReadConcernArgs readConcern;
+ auto readConcernParseStatus = readConcern.initialize(request.getCommandArgs());
+ if (!readConcernParseStatus.isOK()) {
replyBuilder->setMetadata(rpc::makeEmptyMetadata())
- .setCommandReply(readAfterParseStatus);
+ .setCommandReply(readConcernParseStatus);
return false;
}
- auto readAfterResult = replCoord->waitUntilOpTime(txn, readAfterOptimeSettings);
- readAfterResult.appendInfo(&replyBuilderBob);
- if (!readAfterResult.getStatus().isOK()) {
- replyBuilder->setMetadata(rpc::makeEmptyMetadata())
- .setCommandReply(readAfterResult.getStatus(), replyBuilderBob.done());
- return false;
+ if (!supportsReadConcern()) {
+ // Only return an error if a non-nullish readConcern was parsed, but do not process
+ // readConcern regardless.
+ if (!readConcern.getOpTime().isNull() ||
+ readConcern.getLevel() !=
+ repl::ReadConcernArgs::ReadConcernLevel::kLocalReadConcern) {
+ replyBuilder->setMetadata(rpc::makeEmptyMetadata())
+ .setCommandReply({ErrorCodes::InvalidOptions,
+ str::stream()
+ << "Command " << name << " does not support "
+ << repl::ReadConcernArgs::kReadConcernFieldName});
+ return false;
+ }
+ } else {
+ if (readConcern.getLevel() ==
+ repl::ReadConcernArgs::ReadConcernLevel::kMajorityReadConcern) {
+ // wait for a committed snapshot to exist
+ Status status = txn->recoveryUnit()->setReadFromMajorityCommittedSnapshot();
+ while (status == ErrorCodes::ReadConcernMajorityNotAvailableYet) {
+ WriteConcernOptions writeConcern;
+ writeConcern.wMode = WriteConcernOptions::kMajority;
+ // must be a non-null OpTime that is from before any write
+ repl::ReplicationCoordinator::StatusAndDuration awaitStatus =
+ replCoord->awaitReplication(
+ txn, repl::OpTime(Timestamp(1, 0), -1), writeConcern);
+ if (!awaitStatus.status.isOK()) {
+ replyBuilder->setMetadata(rpc::makeEmptyMetadata()).setCommandReply(status);
+ return false;
+ }
+ status = txn->recoveryUnit()->setReadFromMajorityCommittedSnapshot();
+ }
+ if (!status.isOK()) {
+ replyBuilder->setMetadata(rpc::makeEmptyMetadata()).setCommandReply(status);
+ return false;
+ }
+ } // end of readConcernMajority specific work
+
+ // wait for readConcern to be satisfied
+ auto readConcernResult = replCoord->waitUntilOpTime(txn, readConcern);
+ readConcernResult.appendInfo(&replyBuilderBob);
+ if (!readConcernResult.getStatus().isOK()) {
+ replyBuilder->setMetadata(rpc::makeEmptyMetadata())
+ .setCommandReply(readConcernResult.getStatus(), replyBuilderBob.done());
+ return false;
+ }
}
}
diff --git a/src/mongo/db/geo/haystack.cpp b/src/mongo/db/geo/haystack.cpp
index 789d21c8436..2caef7bc87e 100644
--- a/src/mongo/db/geo/haystack.cpp
+++ b/src/mongo/db/geo/haystack.cpp
@@ -70,7 +70,7 @@ public:
bool slaveOverrideOk() const {
return true;
}
- bool supportsReadMajority() const final {
+ bool supportsReadConcern() const final {
return true;
}
diff --git a/src/mongo/db/repl/oplog.cpp b/src/mongo/db/repl/oplog.cpp
index 2b2d917fab2..09d14a559b5 100644
--- a/src/mongo/db/repl/oplog.cpp
+++ b/src/mongo/db/repl/oplog.cpp
@@ -84,6 +84,7 @@
#include "mongo/scripting/engine.h"
#include "mongo/stdx/memory.h"
#include "mongo/util/elapsed_tracker.h"
+#include "mongo/util/fail_point_service.h"
#include "mongo/util/file.h"
#include "mongo/util/log.h"
#include "mongo/util/mongoutils/str.h"
@@ -101,6 +102,8 @@ std::string rsOplogName = "local.oplog.rs";
std::string masterSlaveOplogName = "local.oplog.$main";
int OPLOG_VERSION = 2;
+MONGO_FP_DECLARE(disableSnapshotting);
+
namespace {
// cached copies of these...so don't rename them, drop them, etc.!!!
Database* _localDB = nullptr;
@@ -878,6 +881,14 @@ void SnapshotThread::run() {
}
}
+ while (MONGO_FAIL_POINT(disableSnapshotting)) {
+ sleepsecs(1);
+ stdx::unique_lock<stdx::mutex> lock(newOpMutex);
+ if (_inShutdown) {
+ return;
+ }
+ }
+
try {
auto txn = client.makeOperationContext();
Lock::GlobalLock globalLock(txn->lockState(), MODE_IS, UINT_MAX);
diff --git a/src/mongo/db/repl/read_concern_args.cpp b/src/mongo/db/repl/read_concern_args.cpp
index 34141a5f53b..ca8ecef6cd6 100644
--- a/src/mongo/db/repl/read_concern_args.cpp
+++ b/src/mongo/db/repl/read_concern_args.cpp
@@ -47,7 +47,8 @@ const string ReadConcernArgs::kOpTimestampFieldName("ts");
const string ReadConcernArgs::kOpTermFieldName("term");
const string ReadConcernArgs::kLevelFieldName("level");
-ReadConcernArgs::ReadConcernArgs() : ReadConcernArgs(OpTime(), ReadConcernLevel::kLocalReadConcern) {}
+ReadConcernArgs::ReadConcernArgs()
+ : ReadConcernArgs(OpTime(), ReadConcernLevel::kLocalReadConcern) {}
ReadConcernArgs::ReadConcernArgs(OpTime opTime, ReadConcernLevel level)
: _opTime(std::move(opTime)), _level(level) {}
diff --git a/src/mongo/db/repl/read_concern_args.h b/src/mongo/db/repl/read_concern_args.h
index 90d558b832f..fbf6ae29604 100644
--- a/src/mongo/db/repl/read_concern_args.h
+++ b/src/mongo/db/repl/read_concern_args.h
@@ -48,7 +48,11 @@ public:
static const std::string kOpTimestampFieldName;
static const std::string kLevelFieldName;
- enum class ReadConcernLevel { kLocalReadConcern, kMajorityReadConcern, kLinearizableReadConcern };
+ enum class ReadConcernLevel {
+ kLocalReadConcern,
+ kMajorityReadConcern,
+ kLinearizableReadConcern
+ };
ReadConcernArgs();
ReadConcernArgs(OpTime opTime, ReadConcernLevel level);
diff --git a/src/mongo/db/repl/replication_coordinator_impl.cpp b/src/mongo/db/repl/replication_coordinator_impl.cpp
index 937e9e05b4b..2ab34723047 100644
--- a/src/mongo/db/repl/replication_coordinator_impl.cpp
+++ b/src/mongo/db/repl/replication_coordinator_impl.cpp
@@ -776,9 +776,17 @@ ReadConcernResponse ReplicationCoordinatorImpl::waitUntilOpTime(OperationContext
const auto& ts = settings.getOpTime();
if (getReplicationMode() != repl::ReplicationCoordinator::modeReplSet) {
- return ReadConcernResponse(
- Status(ErrorCodes::NotAReplicaSet,
- "node needs to be a replica set member to use read after opTime"));
+ // For master/slave and standalone nodes, readAfterOpTime is not supported, so we return
+ // an error. However, we consider all writes "committed" and can treat MajorityReadConcern
+ // as LocalReadConcern, which is immediately satisfied since there is no OpTime to wait for.
+ if (!ts.isNull()) {
+ return ReadConcernResponse(
+ Status(ErrorCodes::NotAReplicaSet,
+ "node needs to be a replica set member to use read after opTime"));
+
+ } else {
+ return ReadConcernResponse(Status::OK(), Milliseconds(0));
+ }
}
Timer timer;
diff --git a/src/mongo/db/repl/replication_coordinator_impl_test.cpp b/src/mongo/db/repl/replication_coordinator_impl_test.cpp
index c72fb88f4ed..aaa7a50fc64 100644
--- a/src/mongo/db/repl/replication_coordinator_impl_test.cpp
+++ b/src/mongo/db/repl/replication_coordinator_impl_test.cpp
@@ -2066,7 +2066,8 @@ TEST_F(ReplCoordTest, CantUseReadAfterIfNotReplSet) {
OperationContextNoop txn;
auto result = getReplCoord()->waitUntilOpTime(
&txn,
- ReadConcernArgs(OpTimeWithTermZero(50, 0), ReadConcernArgs::ReadConcernLevel::kLocalReadConcern));
+ ReadConcernArgs(OpTimeWithTermZero(50, 0),
+ ReadConcernArgs::ReadConcernLevel::kLocalReadConcern));
ASSERT_FALSE(result.didWait());
ASSERT_EQUALS(ErrorCodes::NotAReplicaSet, result.getStatus());
@@ -2087,7 +2088,8 @@ TEST_F(ReplCoordTest, ReadAfterWhileShutdown) {
auto result = getReplCoord()->waitUntilOpTime(
&txn,
- ReadConcernArgs(OpTimeWithTermZero(50, 0), ReadConcernArgs::ReadConcernLevel::kLocalReadConcern));
+ ReadConcernArgs(OpTimeWithTermZero(50, 0),
+ ReadConcernArgs::ReadConcernLevel::kLocalReadConcern));
ASSERT_TRUE(result.didWait());
ASSERT_EQUALS(ErrorCodes::ShutdownInProgress, result.getStatus());
@@ -2108,7 +2110,8 @@ TEST_F(ReplCoordTest, ReadAfterInterrupted) {
auto result = getReplCoord()->waitUntilOpTime(
&txn,
- ReadConcernArgs(OpTimeWithTermZero(50, 0), ReadConcernArgs::ReadConcernLevel::kLocalReadConcern));
+ ReadConcernArgs(OpTimeWithTermZero(50, 0),
+ ReadConcernArgs::ReadConcernLevel::kLocalReadConcern));
ASSERT_TRUE(result.didWait());
ASSERT_EQUALS(ErrorCodes::Interrupted, result.getStatus());
@@ -2141,7 +2144,8 @@ TEST_F(ReplCoordTest, ReadAfterGreaterOpTime) {
getReplCoord()->setMyLastOptime(OpTimeWithTermZero(100, 0));
auto result = getReplCoord()->waitUntilOpTime(
&txn,
- ReadConcernArgs(OpTimeWithTermZero(50, 0), ReadConcernArgs::ReadConcernLevel::kLocalReadConcern));
+ ReadConcernArgs(OpTimeWithTermZero(50, 0),
+ ReadConcernArgs::ReadConcernLevel::kLocalReadConcern));
ASSERT_TRUE(result.didWait());
ASSERT_OK(result.getStatus());
@@ -2185,7 +2189,8 @@ TEST_F(ReplCoordTest, ReadAfterDeferredGreaterOpTime) {
auto result = getReplCoord()->waitUntilOpTime(
&txn,
- ReadConcernArgs(OpTimeWithTermZero(100, 0), ReadConcernArgs::ReadConcernLevel::kLocalReadConcern));
+ ReadConcernArgs(OpTimeWithTermZero(100, 0),
+ ReadConcernArgs::ReadConcernLevel::kLocalReadConcern));
pseudoLogOp.get();
ASSERT_TRUE(result.didWait());
@@ -2224,7 +2229,8 @@ TEST_F(ReplCoordTest, CantUseReadAfterCommittedIfNotReplSet) {
OperationContextNoop txn;
auto result = getReplCoord()->waitUntilOpTime(
&txn,
- ReadConcernArgs(OpTime(Timestamp(50, 0), 0), ReadConcernArgs::ReadConcernLevel::kMajorityReadConcern));
+ ReadConcernArgs(OpTime(Timestamp(50, 0), 0),
+ ReadConcernArgs::ReadConcernLevel::kMajorityReadConcern));
ASSERT_FALSE(result.didWait());
ASSERT_EQUALS(ErrorCodes::NotAReplicaSet, result.getStatus());
@@ -2246,7 +2252,8 @@ TEST_F(ReplCoordTest, ReadAfterCommittedWhileShutdown) {
auto result = getReplCoord()->waitUntilOpTime(
&txn,
- ReadConcernArgs(OpTime(Timestamp(50, 0), 0), ReadConcernArgs::ReadConcernLevel::kMajorityReadConcern));
+ ReadConcernArgs(OpTime(Timestamp(50, 0), 0),
+ ReadConcernArgs::ReadConcernLevel::kMajorityReadConcern));
ASSERT_TRUE(result.didWait());
ASSERT_EQUALS(ErrorCodes::ShutdownInProgress, result.getStatus());
@@ -2268,7 +2275,8 @@ TEST_F(ReplCoordTest, ReadAfterCommittedInterrupted) {
auto result = getReplCoord()->waitUntilOpTime(
&txn,
- ReadConcernArgs(OpTime(Timestamp(50, 0), 0), ReadConcernArgs::ReadConcernLevel::kMajorityReadConcern));
+ ReadConcernArgs(OpTime(Timestamp(50, 0), 0),
+ ReadConcernArgs::ReadConcernLevel::kMajorityReadConcern));
ASSERT_TRUE(result.didWait());
ASSERT_EQUALS(ErrorCodes::Interrupted, result.getStatus());
@@ -2288,7 +2296,8 @@ TEST_F(ReplCoordTest, ReadAfterCommittedGreaterOpTime) {
getReplCoord()->onSnapshotCreate(OpTime(Timestamp(100, 0), 0));
auto result = getReplCoord()->waitUntilOpTime(
&txn,
- ReadConcernArgs(OpTime(Timestamp(50, 0), 0), ReadConcernArgs::ReadConcernLevel::kMajorityReadConcern));
+ ReadConcernArgs(OpTime(Timestamp(50, 0), 0),
+ ReadConcernArgs::ReadConcernLevel::kMajorityReadConcern));
ASSERT_TRUE(result.didWait());
ASSERT_OK(result.getStatus());
@@ -2366,7 +2375,8 @@ TEST_F(ReplCoordTest, ReadAfterCommittedDeferredEqualOpTime) {
});
auto result = getReplCoord()->waitUntilOpTime(
- &txn, ReadConcernArgs(opTimeToWait, ReadConcernArgs::ReadConcernLevel::kMajorityReadConcern));
+ &txn,
+ ReadConcernArgs(opTimeToWait, ReadConcernArgs::ReadConcernLevel::kMajorityReadConcern));
pseudoLogOp.get();
ASSERT_TRUE(result.didWait());
diff --git a/src/mongo/db/storage/recovery_unit.h b/src/mongo/db/storage/recovery_unit.h
index d50da13cb95..a88ff2561e0 100644
--- a/src/mongo/db/storage/recovery_unit.h
+++ b/src/mongo/db/storage/recovery_unit.h
@@ -93,10 +93,10 @@ public:
* change snapshots.
*
* If no snapshot has yet been marked as Majority Committed, returns a status with error
- * code XXX_TEMP_NAME_ReadCommittedCurrentlyUnavailable. After this returns successfully,
- * at any point where implementations attempt to acquire committed snapshot, if there are
- * none available due to a call to SnapshotManager::dropAllSnapshots(), a UserException with
- * the same code should be thrown.
+ * code ReadConcernNotAvailableYet. After this returns successfully, at any point where
+ * implementations attempt to acquire committed snapshot, if there are none available due to a
+ * call to SnapshotManager::dropAllSnapshots(), a UserException with the same code should be
+ * thrown.
*
* StorageEngines that don't support a SnapshotManager should use the default
* implementation.
diff --git a/src/mongo/db/storage/wiredtiger/wiredtiger_recovery_unit.cpp b/src/mongo/db/storage/wiredtiger/wiredtiger_recovery_unit.cpp
index cdc9981df78..c7e51395068 100644
--- a/src/mongo/db/storage/wiredtiger/wiredtiger_recovery_unit.cpp
+++ b/src/mongo/db/storage/wiredtiger/wiredtiger_recovery_unit.cpp
@@ -322,8 +322,8 @@ SnapshotId WiredTigerRecoveryUnit::getSnapshotId() const {
Status WiredTigerRecoveryUnit::setReadFromMajorityCommittedSnapshot() {
if (!_sessionCache->snapshotManager().haveCommittedSnapshot()) {
- return {ErrorCodes::XXX_TEMP_NAME_ReadCommittedCurrentlyUnavailable,
- "XXX_TEMP_NAME_ReadCommittedCurrentlyUnavailable message"};
+ return {ErrorCodes::ReadConcernMajorityNotAvailableYet,
+ "Read concern majority reads are currently not possible."};
}
_readFromMajorityCommittedSnapshot = true;
diff --git a/src/mongo/db/storage/wiredtiger/wiredtiger_snapshot_manager.cpp b/src/mongo/db/storage/wiredtiger/wiredtiger_snapshot_manager.cpp
index c7b099f1578..af0b0b22f13 100644
--- a/src/mongo/db/storage/wiredtiger/wiredtiger_snapshot_manager.cpp
+++ b/src/mongo/db/storage/wiredtiger/wiredtiger_snapshot_manager.cpp
@@ -85,7 +85,7 @@ void WiredTigerSnapshotManager::beginTransactionOnCommittedSnapshot(WT_SESSION*
bool sync) const {
stdx::lock_guard<stdx::mutex> lock(_mutex);
- uassert(ErrorCodes::XXX_TEMP_NAME_ReadCommittedCurrentlyUnavailable,
+ uassert(ErrorCodes::ReadConcernMajorityNotAvailableYet,
"Committed view disappeared while running operation",
_committedSnapshot);