diff options
author | Judah Schvimer <judah@mongodb.com> | 2016-08-17 16:58:12 -0400 |
---|---|---|
committer | Judah Schvimer <judah@mongodb.com> | 2016-08-17 16:58:12 -0400 |
commit | 965066ff4441f95ca757a6a9845fc1b70213e11e (patch) | |
tree | 7b0ad7baf9897940ac9f402c63ec6a344f5ee2e1 /src/mongo/db | |
parent | b9f8113e7f346f1449193834b77dc22fa4b1d8c7 (diff) | |
download | mongo-965066ff4441f95ca757a6a9845fc1b70213e11e.tar.gz |
Revert "SERVER-25637 make DataReplicator replSetGetStatus test less flaky and easier to debug"
This reverts commit 9ef2dd6eb418d61368a0025ba4efc6e81910b12b.
Diffstat (limited to 'src/mongo/db')
-rw-r--r-- | src/mongo/db/repl/data_replicator.h | 4 | ||||
-rw-r--r-- | src/mongo/db/repl/data_replicator_test.cpp | 25 | ||||
-rw-r--r-- | src/mongo/db/repl/databases_cloner.h | 2 |
3 files changed, 17 insertions, 14 deletions
diff --git a/src/mongo/db/repl/data_replicator.h b/src/mongo/db/repl/data_replicator.h index dcb25d64a2f..9b9f1e5bb32 100644 --- a/src/mongo/db/repl/data_replicator.h +++ b/src/mongo/db/repl/data_replicator.h @@ -189,8 +189,8 @@ public: }; struct Stats { - size_t failedInitialSyncAttempts{0}; - size_t maxFailedInitialSyncAttempts{0}; + size_t failedInitialSyncAttempts; + size_t maxFailedInitialSyncAttempts; Date_t initialSyncStart; Date_t initialSyncEnd; std::vector<DataReplicator::InitialSyncAttemptInfo> initialSyncAttemptInfos; diff --git a/src/mongo/db/repl/data_replicator_test.cpp b/src/mongo/db/repl/data_replicator_test.cpp index 5db5dbd1f37..9e52ced7653 100644 --- a/src/mongo/db/repl/data_replicator_test.cpp +++ b/src/mongo/db/repl/data_replicator_test.cpp @@ -1245,7 +1245,7 @@ TEST_F(InitialSyncTest, InitialSyncStateIsResetAfterFailure) { verifySync(getNet(), ErrorCodes::UnrecoverableRollbackError); } -TEST_F(InitialSyncTest, GetInitialSyncProgressReturnsCorrectProgress) { +/*TEST_F(InitialSyncTest, GetInitialSyncProgressReturnsCorrectProgress) { const Responses failedResponses = { {"replSetGetRBID", fromjson(str::stream() << "{ok: 1, rbid:1}")}, // get latest oplog ts @@ -1319,14 +1319,20 @@ TEST_F(InitialSyncTest, GetInitialSyncProgressReturnsCorrectProgress) { startSync(1); + BSONObj progress = getInitialSyncProgress(); + ASSERT_EQUALS(progress.nFields(), 4); + ASSERT_EQUALS(progress.getIntField("failedInitialSyncAttempts"), 0); + ASSERT_EQUALS(progress.getIntField("maxFailedInitialSyncAttempts"), 2); + ASSERT_EQUALS(progress["initialSyncStart"].type(), Date); + ASSERT_EQUALS(progress.getObjectField("initialSyncAttempts"), BSONObj()); + // Play first response to ensure data replicator has entered initial sync state. - setResponses({failedResponses.begin(), failedResponses.begin() + 2}); + setResponses({failedResponses.begin(), failedResponses.begin() + 1}); numGetMoreOplogEntriesMax = 7; playResponses(false); log() << "Done playing first failed response"; - auto progress = getInitialSyncProgress(); - log() << "Progress after first failed response: " << progress; + progress = getInitialSyncProgress(); ASSERT_EQUALS(progress.nFields(), 7); ASSERT_EQUALS(progress.getIntField("failedInitialSyncAttempts"), 0); ASSERT_EQUALS(progress.getIntField("maxFailedInitialSyncAttempts"), 2); @@ -1337,17 +1343,16 @@ TEST_F(InitialSyncTest, GetInitialSyncProgressReturnsCorrectProgress) { ASSERT_EQUALS(progress.getObjectField("databases"), BSON("databasesCloned" << 0)); // Play rest of the failed round of responses. - setResponses({failedResponses.begin() + 2, failedResponses.end()}); + setResponses({failedResponses.begin() + 1, failedResponses.end()}); playResponses(false); log() << "Done playing failed responses"; // Play the first response of the successful round of responses. - setResponses({successfulResponses.begin(), successfulResponses.begin() + 2}); + setResponses({successfulResponses.begin(), successfulResponses.begin() + 1}); playResponses(false); log() << "Done playing first successful response"; progress = getInitialSyncProgress(); - log() << "Progress after failure: " << progress; ASSERT_EQUALS(progress.nFields(), 7); ASSERT_EQUALS(progress.getIntField("failedInitialSyncAttempts"), 1); ASSERT_EQUALS(progress.getIntField("maxFailedInitialSyncAttempts"), 2); @@ -1366,12 +1371,11 @@ TEST_F(InitialSyncTest, GetInitialSyncProgressReturnsCorrectProgress) { ASSERT_EQUALS(attempt0.getStringField("syncSource"), std::string("localhost:27017")); // Play all but last of the successful round of responses. - setResponses({successfulResponses.begin() + 2, successfulResponses.end() - 1}); + setResponses({successfulResponses.begin() + 1, successfulResponses.end() - 1}); playResponses(false); log() << "Done playing all but last successful response"; progress = getInitialSyncProgress(); - log() << "Progress after all but last successful response: " << progress; ASSERT_EQUALS(progress.nFields(), 7); ASSERT_EQUALS(progress.getIntField("failedInitialSyncAttempts"), 1); ASSERT_EQUALS(progress.getIntField("maxFailedInitialSyncAttempts"), 2); @@ -1403,7 +1407,6 @@ TEST_F(InitialSyncTest, GetInitialSyncProgressReturnsCorrectProgress) { verifySync(getNet()); progress = getInitialSyncProgress(); - log() << "Progress at end: " << progress; ASSERT_EQUALS(progress.nFields(), 6); ASSERT_EQUALS(progress.getIntField("failedInitialSyncAttempts"), 1); ASSERT_EQUALS(progress.getIntField("maxFailedInitialSyncAttempts"), 2); @@ -1426,7 +1429,7 @@ TEST_F(InitialSyncTest, GetInitialSyncProgressReturnsCorrectProgress) { ASSERT_EQUALS(attempt1.getStringField("status"), std::string("OK")); ASSERT_EQUALS(attempt1["durationMillis"].type(), NumberInt); ASSERT_EQUALS(attempt1.getStringField("syncSource"), std::string("localhost:27017")); -} +}*/ class TestSyncSourceSelector2 : public SyncSourceSelector { diff --git a/src/mongo/db/repl/databases_cloner.h b/src/mongo/db/repl/databases_cloner.h index 14d815f9e1a..4bfe44b1c16 100644 --- a/src/mongo/db/repl/databases_cloner.h +++ b/src/mongo/db/repl/databases_cloner.h @@ -64,7 +64,7 @@ using UniqueLock = stdx::unique_lock<stdx::mutex>; class DatabasesCloner { public: struct Stats { - size_t databasesCloned{0}; + size_t databasesCloned = 0U; std::vector<DatabaseCloner::Stats> databaseStats; std::string toString() const; |