summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAllison Easton <allison.easton@mongodb.com>2021-07-01 07:00:02 +0000
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2021-07-02 07:03:29 +0000
commitad76f3d82345b004a54010ba235f17c716eee0fd (patch)
tree1b6c42b139757074397213555b0fc04c8ace8715 /src
parent8edc5e1b01d5f5f0181559042b529583ca2a5c6e (diff)
downloadmongo-ad76f3d82345b004a54010ba235f17c716eee0fd.tar.gz
SERVER-53033 Investigate usages on "not master" error messages in sharding unittests
Diffstat (limited to 'src')
-rw-r--r--src/mongo/db/s/dist_lock_catalog_replset_test.cpp2
-rw-r--r--src/mongo/db/s/dist_lock_manager_replset_test.cpp2
-rw-r--r--src/mongo/s/catalog/sharding_catalog_client_test.cpp6
-rw-r--r--src/mongo/s/catalog/sharding_catalog_write_retry_test.cpp6
-rw-r--r--src/mongo/s/sessions_collection_sharded_test.cpp4
5 files changed, 10 insertions, 10 deletions
diff --git a/src/mongo/db/s/dist_lock_catalog_replset_test.cpp b/src/mongo/db/s/dist_lock_catalog_replset_test.cpp
index 0d8cbae56b0..780e82f6d88 100644
--- a/src/mongo/db/s/dist_lock_catalog_replset_test.cpp
+++ b/src/mongo/db/s/dist_lock_catalog_replset_test.cpp
@@ -561,7 +561,7 @@ TEST_F(DistLockCatalogReplSetTest, GrabLockWriteConcernError) {
value: null,
writeConcernError: {
code: 10107,
- errmsg: "Not master while waiting for write concern"
+ errmsg: "Not primary while waiting for write concern"
}
})");
});
diff --git a/src/mongo/db/s/dist_lock_manager_replset_test.cpp b/src/mongo/db/s/dist_lock_manager_replset_test.cpp
index bd75caa8745..247bbb6cb97 100644
--- a/src/mongo/db/s/dist_lock_manager_replset_test.cpp
+++ b/src/mongo/db/s/dist_lock_manager_replset_test.cpp
@@ -1243,7 +1243,7 @@ TEST_F(DistLockManagerReplSetTest, CannotOvertakeIfNoMaster) {
} else {
getMockCatalog()->expectGetServerInfo(
[&getServerInfoCallCount]() { getServerInfoCallCount++; },
- {ErrorCodes::NotWritablePrimary, "not master"});
+ {ErrorCodes::NotWritablePrimary, "not primary"});
}
auto status = DistLockManager::get(operationContext())
diff --git a/src/mongo/s/catalog/sharding_catalog_client_test.cpp b/src/mongo/s/catalog/sharding_catalog_client_test.cpp
index eaffa9445d9..54528489f36 100644
--- a/src/mongo/s/catalog/sharding_catalog_client_test.cpp
+++ b/src/mongo/s/catalog/sharding_catalog_client_test.cpp
@@ -246,7 +246,7 @@ TEST_F(ShardingCatalogClientTest, GetDatabaseStaleSecondaryRetryNoPrimary) {
ASSERT_EQUALS(testHost, request.target);
// Make it so when it attempts to retarget and retry it will get a NotWritablePrimary error.
configTargeter()->setFindHostReturnValue(
- Status(ErrorCodes::NotWritablePrimary, "no config master"));
+ Status(ErrorCodes::NotWritablePrimary, "no config primary"));
return vector<BSONObj>{};
});
@@ -695,7 +695,7 @@ TEST_F(ShardingCatalogClientTest, RunUserManagementWriteCommandNotWritablePrimar
onCommand([](const RemoteCommandRequest& request) {
BSONObjBuilder responseBuilder;
CommandHelpers::appendCommandStatusNoThrow(
- responseBuilder, Status(ErrorCodes::NotWritablePrimary, "not master"));
+ responseBuilder, Status(ErrorCodes::NotWritablePrimary, "not primary"));
return responseBuilder.obj();
});
}
@@ -726,7 +726,7 @@ TEST_F(ShardingCatalogClientTest, RunUserManagementWriteCommandNotWritablePrimar
BSONObjBuilder responseBuilder;
CommandHelpers::appendCommandStatusNoThrow(
- responseBuilder, Status(ErrorCodes::NotWritablePrimary, "not master"));
+ responseBuilder, Status(ErrorCodes::NotWritablePrimary, "not primary"));
// Ensure that when the catalog manager tries to retarget after getting the
// NotWritablePrimary response, it will get back a new target.
diff --git a/src/mongo/s/catalog/sharding_catalog_write_retry_test.cpp b/src/mongo/s/catalog/sharding_catalog_write_retry_test.cpp
index 67f1cc2a4ff..7ad45617c41 100644
--- a/src/mongo/s/catalog/sharding_catalog_write_retry_test.cpp
+++ b/src/mongo/s/catalog/sharding_catalog_write_retry_test.cpp
@@ -372,7 +372,7 @@ TEST_F(UpdateRetryTest, NotWritablePrimaryErrorReturnedPersistently) {
onCommand([](const RemoteCommandRequest& request) {
BSONObjBuilder bb;
CommandHelpers::appendCommandStatusNoThrow(
- bb, {ErrorCodes::NotWritablePrimary, "not master"});
+ bb, {ErrorCodes::NotWritablePrimary, "not primary"});
return bb.obj();
});
}
@@ -381,7 +381,7 @@ TEST_F(UpdateRetryTest, NotWritablePrimaryErrorReturnedPersistently) {
}
TEST_F(UpdateRetryTest, NotWritablePrimaryReturnedFromTargeter) {
- configTargeter()->setFindHostReturnValue(Status(ErrorCodes::NotWritablePrimary, "not master"));
+ configTargeter()->setFindHostReturnValue(Status(ErrorCodes::NotWritablePrimary, "not primary"));
BSONObj objToUpdate = BSON("_id" << 1 << "Value"
<< "TestValue");
@@ -435,7 +435,7 @@ TEST_F(UpdateRetryTest, NotWritablePrimaryOnceSuccessAfterRetry) {
BSONObjBuilder bb;
CommandHelpers::appendCommandStatusNoThrow(bb,
- {ErrorCodes::NotWritablePrimary, "not master"});
+ {ErrorCodes::NotWritablePrimary, "not primary"});
return bb.obj();
});
diff --git a/src/mongo/s/sessions_collection_sharded_test.cpp b/src/mongo/s/sessions_collection_sharded_test.cpp
index aab98efcbde..a5976752058 100644
--- a/src/mongo/s/sessions_collection_sharded_test.cpp
+++ b/src/mongo/s/sessions_collection_sharded_test.cpp
@@ -137,7 +137,7 @@ TEST_F(SessionsCollectionShardedTest, RefreshOneSessionWriteErrTest) {
response.addToErrDetails([&] {
WriteErrorDetail* errDetail = new WriteErrorDetail();
errDetail->setIndex(0);
- errDetail->setStatus({ErrorCodes::NotWritablePrimary, "not master"});
+ errDetail->setStatus({ErrorCodes::NotWritablePrimary, "not primary"});
return errDetail;
}());
return response.toBSON();
@@ -192,7 +192,7 @@ TEST_F(SessionsCollectionShardedTest, RemoveOneSessionWriteErrTest) {
response.addToErrDetails([&] {
WriteErrorDetail* errDetail = new WriteErrorDetail();
errDetail->setIndex(0);
- errDetail->setStatus({ErrorCodes::NotWritablePrimary, "not master"});
+ errDetail->setStatus({ErrorCodes::NotWritablePrimary, "not primary"});
return errDetail;
}());
return response.toBSON();