diff options
Diffstat (limited to 'src/mongo/db/repl/topology_coordinator_impl_v1_test.cpp')
-rw-r--r-- | src/mongo/db/repl/topology_coordinator_impl_v1_test.cpp | 328 |
1 files changed, 178 insertions, 150 deletions
diff --git a/src/mongo/db/repl/topology_coordinator_impl_v1_test.cpp b/src/mongo/db/repl/topology_coordinator_impl_v1_test.cpp index 80fc9c3bf52..f4e43bf3e0b 100644 --- a/src/mongo/db/repl/topology_coordinator_impl_v1_test.cpp +++ b/src/mongo/db/repl/topology_coordinator_impl_v1_test.cpp @@ -2044,7 +2044,8 @@ TEST_F(TopoCoordTest, BecomeCandidateWhenReconfigToBeElectableInSingleNodeSet) { << BSON_ARRAY(BSON("_id" << 1 << "host" << "hself" << "priority" - << 0)))); + << 0)))) + .transitional_ignore(); getTopoCoord().updateConfig(cfg, 0, now()++); ASSERT_EQUALS(MemberState::RS_STARTUP2, getTopoCoord().getMemberState().s); @@ -2078,7 +2079,8 @@ TEST_F(TopoCoordTest, NodeDoesNotBecomeCandidateWhenBecomingSecondaryInSingleNod << BSON_ARRAY(BSON("_id" << 1 << "host" << "hself" << "priority" - << 0)))); + << 0)))) + .transitional_ignore(); getTopoCoord().updateConfig(cfg, 0, now()++); ASSERT_EQUALS(MemberState::RS_STARTUP2, getTopoCoord().getMemberState().s); @@ -2442,7 +2444,8 @@ TEST_F(TopoCoordTest, NodeDoesNotGrantVotesToTwoDifferentNodesInTheSameTerm) { << "configVersion" << 1LL << "lastCommittedOp" - << BSON("ts" << Timestamp(10, 0) << "term" << 0LL))); + << BSON("ts" << Timestamp(10, 0) << "term" << 0LL))) + .transitional_ignore(); ReplSetRequestVotesResponse response; getTopoCoord().processReplSetRequestVotes(args, &response); @@ -2450,17 +2453,18 @@ TEST_F(TopoCoordTest, NodeDoesNotGrantVotesToTwoDifferentNodesInTheSameTerm) { ASSERT_TRUE(response.getVoteGranted()); ReplSetRequestVotesArgs args2; - args2.initialize( - BSON("replSetRequestVotes" << 1 << "setName" - << "rs0" - << "term" - << 1LL - << "candidateIndex" - << 1LL - << "configVersion" - << 1LL - << "lastCommittedOp" - << BSON("ts" << Timestamp(10, 0) << "term" << 0LL))); + args2 + .initialize(BSON("replSetRequestVotes" << 1 << "setName" + << "rs0" + << "term" + << 1LL + << "candidateIndex" + << 1LL + << "configVersion" + << 1LL + << "lastCommittedOp" + << BSON("ts" << Timestamp(10, 0) << "term" << 0LL))) + .transitional_ignore(); ReplSetRequestVotesResponse response2; // different candidate same term, should be a problem @@ -2498,7 +2502,8 @@ TEST_F(TopoCoordTest, DryRunVoteRequestShouldNotPreventSubsequentDryRunsForThatT << "configVersion" << 1LL << "lastCommittedOp" - << BSON("ts" << Timestamp(10, 0) << "term" << 0LL))); + << BSON("ts" << Timestamp(10, 0) << "term" << 0LL))) + .transitional_ignore(); ReplSetRequestVotesResponse response; getTopoCoord().processReplSetRequestVotes(args, &response); @@ -2507,19 +2512,20 @@ TEST_F(TopoCoordTest, DryRunVoteRequestShouldNotPreventSubsequentDryRunsForThatT // second dry run fine ReplSetRequestVotesArgs args2; - args2.initialize( - BSON("replSetRequestVotes" << 1 << "setName" - << "rs0" - << "dryRun" - << true - << "term" - << 1LL - << "candidateIndex" - << 0LL - << "configVersion" - << 1LL - << "lastCommittedOp" - << BSON("ts" << Timestamp(10, 0) << "term" << 0LL))); + args2 + .initialize(BSON("replSetRequestVotes" << 1 << "setName" + << "rs0" + << "dryRun" + << true + << "term" + << 1LL + << "candidateIndex" + << 0LL + << "configVersion" + << 1LL + << "lastCommittedOp" + << BSON("ts" << Timestamp(10, 0) << "term" << 0LL))) + .transitional_ignore(); ReplSetRequestVotesResponse response2; getTopoCoord().processReplSetRequestVotes(args2, &response2); @@ -2528,19 +2534,20 @@ TEST_F(TopoCoordTest, DryRunVoteRequestShouldNotPreventSubsequentDryRunsForThatT // real request fine ReplSetRequestVotesArgs args3; - args3.initialize( - BSON("replSetRequestVotes" << 1 << "setName" - << "rs0" - << "dryRun" - << false - << "term" - << 1LL - << "candidateIndex" - << 0LL - << "configVersion" - << 1LL - << "lastCommittedOp" - << BSON("ts" << Timestamp(10, 0) << "term" << 0LL))); + args3 + .initialize(BSON("replSetRequestVotes" << 1 << "setName" + << "rs0" + << "dryRun" + << false + << "term" + << 1LL + << "candidateIndex" + << 0LL + << "configVersion" + << 1LL + << "lastCommittedOp" + << BSON("ts" << Timestamp(10, 0) << "term" << 0LL))) + .transitional_ignore(); ReplSetRequestVotesResponse response3; getTopoCoord().processReplSetRequestVotes(args3, &response3); @@ -2549,19 +2556,20 @@ TEST_F(TopoCoordTest, DryRunVoteRequestShouldNotPreventSubsequentDryRunsForThatT // dry post real, fails ReplSetRequestVotesArgs args4; - args4.initialize( - BSON("replSetRequestVotes" << 1 << "setName" - << "rs0" - << "dryRun" - << false - << "term" - << 1LL - << "candidateIndex" - << 0LL - << "configVersion" - << 1LL - << "lastCommittedOp" - << BSON("ts" << Timestamp(10, 0) << "term" << 0LL))); + args4 + .initialize(BSON("replSetRequestVotes" << 1 << "setName" + << "rs0" + << "dryRun" + << false + << "term" + << 1LL + << "candidateIndex" + << 0LL + << "configVersion" + << 1LL + << "lastCommittedOp" + << BSON("ts" << Timestamp(10, 0) << "term" << 0LL))) + .transitional_ignore(); ReplSetRequestVotesResponse response4; getTopoCoord().processReplSetRequestVotes(args4, &response4); @@ -2598,7 +2606,8 @@ TEST_F(TopoCoordTest, VoteRequestShouldNotPreventDryRunsForThatTerm) { << "configVersion" << 1LL << "lastCommittedOp" - << BSON("ts" << Timestamp(10, 0) << "term" << 0LL))); + << BSON("ts" << Timestamp(10, 0) << "term" << 0LL))) + .transitional_ignore(); ReplSetRequestVotesResponse response; getTopoCoord().processReplSetRequestVotes(args, &response); @@ -2607,19 +2616,20 @@ TEST_F(TopoCoordTest, VoteRequestShouldNotPreventDryRunsForThatTerm) { // dry post real, fails ReplSetRequestVotesArgs args2; - args2.initialize( - BSON("replSetRequestVotes" << 1 << "setName" - << "rs0" - << "dryRun" - << false - << "term" - << 1LL - << "candidateIndex" - << 0LL - << "configVersion" - << 1LL - << "lastCommittedOp" - << BSON("ts" << Timestamp(10, 0) << "term" << 0LL))); + args2 + .initialize(BSON("replSetRequestVotes" << 1 << "setName" + << "rs0" + << "dryRun" + << false + << "term" + << 1LL + << "candidateIndex" + << 0LL + << "configVersion" + << 1LL + << "lastCommittedOp" + << BSON("ts" << Timestamp(10, 0) << "term" << 0LL))) + .transitional_ignore(); ReplSetRequestVotesResponse response2; getTopoCoord().processReplSetRequestVotes(args2, &response2); @@ -2654,7 +2664,8 @@ TEST_F(TopoCoordTest, NodeDoesNotGrantVoteWhenReplSetNameDoesNotMatch) { << "configVersion" << 1LL << "lastCommittedOp" - << BSON("ts" << Timestamp(10, 0) << "term" << 0LL))); + << BSON("ts" << Timestamp(10, 0) << "term" << 0LL))) + .transitional_ignore(); ReplSetRequestVotesResponse response; getTopoCoord().processReplSetRequestVotes(args, &response); @@ -2688,7 +2699,8 @@ TEST_F(TopoCoordTest, NodeDoesNotGrantVoteWhenConfigVersionDoesNotMatch) { << "configVersion" << 0LL << "lastCommittedOp" - << BSON("ts" << Timestamp(10, 0) << "term" << 0LL))); + << BSON("ts" << Timestamp(10, 0) << "term" << 0LL))) + .transitional_ignore(); ReplSetRequestVotesResponse response; getTopoCoord().processReplSetRequestVotes(args, &response); @@ -2726,7 +2738,8 @@ TEST_F(TopoCoordTest, NodeDoesNotGrantVoteWhenTermIsStale) { << "configVersion" << 1LL << "lastCommittedOp" - << BSON("ts" << Timestamp(10, 0) << "term" << 0LL))); + << BSON("ts" << Timestamp(10, 0) << "term" << 0LL))) + .transitional_ignore(); ReplSetRequestVotesResponse response; getTopoCoord().processReplSetRequestVotes(args, &response); @@ -2762,7 +2775,8 @@ TEST_F(TopoCoordTest, NodeDoesNotGrantVoteWhenOpTimeIsStale) { << "configVersion" << 1LL << "lastCommittedOp" - << BSON("ts" << Timestamp(10, 0) << "term" << 0LL))); + << BSON("ts" << Timestamp(10, 0) << "term" << 0LL))) + .transitional_ignore(); ReplSetRequestVotesResponse response; getTopoCoord().getMyMemberData()->setLastAppliedOpTime({Timestamp(20, 0), 0}, Date_t()); @@ -2795,17 +2809,18 @@ TEST_F(TopoCoordTest, NodeDoesNotGrantDryRunVoteWhenReplSetNameDoesNotMatch) { getTopoCoord().updateTerm(1, now())); // and make sure we voted in term 1 ReplSetRequestVotesArgs argsForRealVote; - argsForRealVote.initialize( - BSON("replSetRequestVotes" << 1 << "setName" - << "rs0" - << "term" - << 1LL - << "candidateIndex" - << 0LL - << "configVersion" - << 1LL - << "lastCommittedOp" - << BSON("ts" << Timestamp(10, 0) << "term" << 0LL))); + argsForRealVote + .initialize(BSON("replSetRequestVotes" << 1 << "setName" + << "rs0" + << "term" + << 1LL + << "candidateIndex" + << 0LL + << "configVersion" + << 1LL + << "lastCommittedOp" + << BSON("ts" << Timestamp(10, 0) << "term" << 0LL))) + .transitional_ignore(); ReplSetRequestVotesResponse responseForRealVote; getTopoCoord().processReplSetRequestVotes(argsForRealVote, &responseForRealVote); @@ -2826,7 +2841,8 @@ TEST_F(TopoCoordTest, NodeDoesNotGrantDryRunVoteWhenReplSetNameDoesNotMatch) { << "configVersion" << 1LL << "lastCommittedOp" - << BSON("ts" << Timestamp(10, 0) << "term" << 0LL))); + << BSON("ts" << Timestamp(10, 0) << "term" << 0LL))) + .transitional_ignore(); ReplSetRequestVotesResponse response; getTopoCoord().processReplSetRequestVotes(args, &response); @@ -2854,17 +2870,18 @@ TEST_F(TopoCoordTest, NodeDoesNotGrantDryRunVoteWhenConfigVersionDoesNotMatch) { getTopoCoord().updateTerm(1, now())); // and make sure we voted in term 1 ReplSetRequestVotesArgs argsForRealVote; - argsForRealVote.initialize( - BSON("replSetRequestVotes" << 1 << "setName" - << "rs0" - << "term" - << 1LL - << "candidateIndex" - << 0LL - << "configVersion" - << 1LL - << "lastCommittedOp" - << BSON("ts" << Timestamp(10, 0) << "term" << 0LL))); + argsForRealVote + .initialize(BSON("replSetRequestVotes" << 1 << "setName" + << "rs0" + << "term" + << 1LL + << "candidateIndex" + << 0LL + << "configVersion" + << 1LL + << "lastCommittedOp" + << BSON("ts" << Timestamp(10, 0) << "term" << 0LL))) + .transitional_ignore(); ReplSetRequestVotesResponse responseForRealVote; getTopoCoord().processReplSetRequestVotes(argsForRealVote, &responseForRealVote); @@ -2885,7 +2902,8 @@ TEST_F(TopoCoordTest, NodeDoesNotGrantDryRunVoteWhenConfigVersionDoesNotMatch) { << "configVersion" << 0LL << "lastCommittedOp" - << BSON("ts" << Timestamp(10, 0) << "term" << 0LL))); + << BSON("ts" << Timestamp(10, 0) << "term" << 0LL))) + .transitional_ignore(); ReplSetRequestVotesResponse response; getTopoCoord().processReplSetRequestVotes(args, &response); @@ -2913,17 +2931,18 @@ TEST_F(TopoCoordTest, NodeDoesNotGrantDryRunVoteWhenTermIsStale) { getTopoCoord().updateTerm(1, now())); // and make sure we voted in term 1 ReplSetRequestVotesArgs argsForRealVote; - argsForRealVote.initialize( - BSON("replSetRequestVotes" << 1 << "setName" - << "rs0" - << "term" - << 1LL - << "candidateIndex" - << 0LL - << "configVersion" - << 1LL - << "lastCommittedOp" - << BSON("ts" << Timestamp(10, 0) << "term" << 0LL))); + argsForRealVote + .initialize(BSON("replSetRequestVotes" << 1 << "setName" + << "rs0" + << "term" + << 1LL + << "candidateIndex" + << 0LL + << "configVersion" + << 1LL + << "lastCommittedOp" + << BSON("ts" << Timestamp(10, 0) << "term" << 0LL))) + .transitional_ignore(); ReplSetRequestVotesResponse responseForRealVote; getTopoCoord().processReplSetRequestVotes(argsForRealVote, &responseForRealVote); @@ -2943,7 +2962,8 @@ TEST_F(TopoCoordTest, NodeDoesNotGrantDryRunVoteWhenTermIsStale) { << "configVersion" << 1LL << "lastCommittedOp" - << BSON("ts" << Timestamp(10, 0) << "term" << 0LL))); + << BSON("ts" << Timestamp(10, 0) << "term" << 0LL))) + .transitional_ignore(); ReplSetRequestVotesResponse response; getTopoCoord().processReplSetRequestVotes(args, &response); @@ -2971,17 +2991,18 @@ TEST_F(TopoCoordTest, GrantDryRunVoteEvenWhenTermHasBeenSeen) { getTopoCoord().updateTerm(1, now())); // and make sure we voted in term 1 ReplSetRequestVotesArgs argsForRealVote; - argsForRealVote.initialize( - BSON("replSetRequestVotes" << 1 << "setName" - << "rs0" - << "term" - << 1LL - << "candidateIndex" - << 0LL - << "configVersion" - << 1LL - << "lastCommittedOp" - << BSON("ts" << Timestamp(10, 0) << "term" << 0LL))); + argsForRealVote + .initialize(BSON("replSetRequestVotes" << 1 << "setName" + << "rs0" + << "term" + << 1LL + << "candidateIndex" + << 0LL + << "configVersion" + << 1LL + << "lastCommittedOp" + << BSON("ts" << Timestamp(10, 0) << "term" << 0LL))) + .transitional_ignore(); ReplSetRequestVotesResponse responseForRealVote; getTopoCoord().processReplSetRequestVotes(argsForRealVote, &responseForRealVote); @@ -3002,7 +3023,8 @@ TEST_F(TopoCoordTest, GrantDryRunVoteEvenWhenTermHasBeenSeen) { << "configVersion" << 1LL << "lastCommittedOp" - << BSON("ts" << Timestamp(10, 0) << "term" << 0LL))); + << BSON("ts" << Timestamp(10, 0) << "term" << 0LL))) + .transitional_ignore(); ReplSetRequestVotesResponse response; getTopoCoord().processReplSetRequestVotes(args, &response); @@ -3030,17 +3052,18 @@ TEST_F(TopoCoordTest, DoNotGrantDryRunVoteWhenOpTimeIsStale) { getTopoCoord().updateTerm(1, now())); // and make sure we voted in term 1 ReplSetRequestVotesArgs argsForRealVote; - argsForRealVote.initialize( - BSON("replSetRequestVotes" << 1 << "setName" - << "rs0" - << "term" - << 1LL - << "candidateIndex" - << 0LL - << "configVersion" - << 1LL - << "lastCommittedOp" - << BSON("ts" << Timestamp(10, 0) << "term" << 0LL))); + argsForRealVote + .initialize(BSON("replSetRequestVotes" << 1 << "setName" + << "rs0" + << "term" + << 1LL + << "candidateIndex" + << 0LL + << "configVersion" + << 1LL + << "lastCommittedOp" + << BSON("ts" << Timestamp(10, 0) << "term" << 0LL))) + .transitional_ignore(); ReplSetRequestVotesResponse responseForRealVote; getTopoCoord().processReplSetRequestVotes(argsForRealVote, &responseForRealVote); @@ -3061,7 +3084,8 @@ TEST_F(TopoCoordTest, DoNotGrantDryRunVoteWhenOpTimeIsStale) { << "configVersion" << 1LL << "lastCommittedOp" - << BSON("ts" << Timestamp(10, 0) << "term" << 0LL))); + << BSON("ts" << Timestamp(10, 0) << "term" << 0LL))) + .transitional_ignore(); ReplSetRequestVotesResponse response; getTopoCoord().getMyMemberData()->setLastAppliedOpTime({Timestamp(20, 0), 0}, Date_t()); @@ -3552,7 +3576,8 @@ TEST_F(HeartbeatResponseTestV1, ReconfigNodeRemovedBetweenHeartbeatRequestAndRep 0); ReplSetHeartbeatResponse hb; - hb.initialize(BSON("ok" << 1 << "v" << 1 << "state" << MemberState::RS_PRIMARY), 0); + hb.initialize(BSON("ok" << 1 << "v" << 1 << "state" << MemberState::RS_PRIMARY), 0) + .transitional_ignore(); hb.setDurableOpTime(lastOpTimeApplied); hb.setElectionTime(election.getTimestamp()); StatusWith<ReplSetHeartbeatResponse> hbResponse = StatusWith<ReplSetHeartbeatResponse>(hb); @@ -3598,7 +3623,8 @@ TEST_F(HeartbeatResponseTestV1, ReconfigBetweenHeartbeatRequestAndRepsonse) { 0); ReplSetHeartbeatResponse hb; - hb.initialize(BSON("ok" << 1 << "v" << 1 << "state" << MemberState::RS_PRIMARY), 0); + hb.initialize(BSON("ok" << 1 << "v" << 1 << "state" << MemberState::RS_PRIMARY), 0) + .transitional_ignore(); hb.setDurableOpTime(lastOpTimeApplied); hb.setElectionTime(election.getTimestamp()); StatusWith<ReplSetHeartbeatResponse> hbResponse = StatusWith<ReplSetHeartbeatResponse>(hb); @@ -3900,7 +3926,7 @@ TEST_F(HeartbeatResponseTestV1, // Freeze node to set stepdown wait. BSONObjBuilder response; - getTopoCoord().prepareFreezeResponse(now()++, 20, &response); + getTopoCoord().prepareFreezeResponse(now()++, 20, &response).status_with_transitional_ignore(); nextAction = receiveDownHeartbeat(HostAndPort("host2"), "rs0"); ASSERT_EQUALS(-1, getCurrentPrimaryIndex()); @@ -4659,21 +4685,23 @@ TEST_F(HeartbeatResponseHighVerbosityTestV1, UpdateHeartbeatDataSameConfig) { // construct a copy of the original config for log message checking later // see HeartbeatResponseTest for the origin of the original config ReplSetConfig originalConfig; - originalConfig.initialize(BSON("_id" - << "rs0" - << "version" - << 5 - << "members" - << BSON_ARRAY(BSON("_id" << 0 << "host" - << "host1:27017") - << BSON("_id" << 1 << "host" - << "host2:27017") - << BSON("_id" << 2 << "host" - << "host3:27017")) - << "protocolVersion" - << 1 - << "settings" - << BSON("heartbeatTimeoutSecs" << 5))); + originalConfig + .initialize(BSON("_id" + << "rs0" + << "version" + << 5 + << "members" + << BSON_ARRAY(BSON("_id" << 0 << "host" + << "host1:27017") + << BSON("_id" << 1 << "host" + << "host2:27017") + << BSON("_id" << 2 << "host" + << "host3:27017")) + << "protocolVersion" + << 1 + << "settings" + << BSON("heartbeatTimeoutSecs" << 5))) + .transitional_ignore(); ReplSetHeartbeatResponse sameConfigResponse; sameConfigResponse.noteReplSet(); |