mirror of
https://github.com/mongodb/mongo.git
synced 2024-12-01 09:32:32 +01:00
SERVER-53033 Investigate usages on "not master" error messages in sharding unittests
This commit is contained in:
parent
8edc5e1b01
commit
ad76f3d823
@ -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"
|
||||
}
|
||||
})");
|
||||
});
|
||||
|
@ -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())
|
||||
|
@ -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.
|
||||
|
@ -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();
|
||||
});
|
||||
|
||||
|
@ -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();
|
||||
|
Loading…
Reference in New Issue
Block a user