diff options
author | Benety Goh <benety@mongodb.com> | 2020-05-03 14:59:39 -0400 |
---|---|---|
committer | Evergreen Agent <no-reply@evergreen.mongodb.com> | 2020-05-03 19:12:43 +0000 |
commit | 5b34bef6553fe843b0fda58094f17f96dc3598d9 (patch) | |
tree | 656e67e9e5a17649de07264a90432670630de5bd | |
parent | 881a4522ecf55dd585c0c4cf296aa750b2de000f (diff) | |
download | mongo-5b34bef6553fe843b0fda58094f17f96dc3598d9.tar.gz |
SERVER-38961 remove ReplSetTest.waitForAllIndexBuildsToFinish()
-rw-r--r-- | jstests/gle/create_index_gle.js | 2 | ||||
-rw-r--r-- | jstests/noPassthrough/commit_quorum.js | 2 | ||||
-rw-r--r-- | jstests/noPassthrough/list_indexes_with_build_uuids.js | 2 | ||||
-rw-r--r-- | jstests/noPassthrough/plan_cache_index_create.js | 6 | ||||
-rw-r--r-- | jstests/replsets/buildindexes_false_with_system_indexes.js | 4 | ||||
-rw-r--r-- | jstests/replsets/reindex.js | 2 | ||||
-rw-r--r-- | jstests/replsets/replset1.js | 2 | ||||
-rw-r--r-- | jstests/replsets/secondary_as_sync_source.js | 2 | ||||
-rw-r--r-- | jstests/replsets/secondary_reads_timestamp_visibility.js | 2 | ||||
-rw-r--r-- | jstests/replsets/text_index_limits.js | 2 | ||||
-rw-r--r-- | src/mongo/shell/replsettest.js | 4 |
11 files changed, 13 insertions, 17 deletions
diff --git a/jstests/gle/create_index_gle.js b/jstests/gle/create_index_gle.js index b8b63182924..8a10e5a2e9f 100644 --- a/jstests/gle/create_index_gle.js +++ b/jstests/gle/create_index_gle.js @@ -41,7 +41,7 @@ testDB.user.insert({x: 1}); testDB.user.ensureIndex({x: 1}); assert.gleOK(testDB.runCommand({getLastError: 1, w: 2})); -replTest.waitForAllIndexBuildsToFinish('test', 'user'); +replTest.awaitReplication(); var priIdx = testDB.user.getIndexes(); var secIdx = testDB2.user.getIndexes(); diff --git a/jstests/noPassthrough/commit_quorum.js b/jstests/noPassthrough/commit_quorum.js index 269fdb4b96a..2048ad7d322 100644 --- a/jstests/noPassthrough/commit_quorum.js +++ b/jstests/noPassthrough/commit_quorum.js @@ -61,7 +61,7 @@ assert.eq("votingMembers", res.commitQuorum); res = assert.commandWorked(testDB[collName].createIndexes([{j: 1}], {}, 1)); assert.eq(1, res.commitQuorum); -replSet.waitForAllIndexBuildsToFinish(testDB.getName(), collName); +replSet.awaitReplication(); let awaitShell; try { diff --git a/jstests/noPassthrough/list_indexes_with_build_uuids.js b/jstests/noPassthrough/list_indexes_with_build_uuids.js index 711658feb05..ff8c9d3ccd2 100644 --- a/jstests/noPassthrough/list_indexes_with_build_uuids.js +++ b/jstests/noPassthrough/list_indexes_with_build_uuids.js @@ -52,7 +52,7 @@ replSet.awaitReplication(); // Build and finish the first index. assert.commandWorked(primaryDB.runCommand( {createIndexes: collName, indexes: [{key: {i: 1}, name: firstIndexName, background: true}]})); -replSet.waitForAllIndexBuildsToFinish(dbName, collName); +replSet.awaitReplication(); // Start hanging index builds on the secondary. IndexBuildTest.pauseIndexBuilds(secondary); diff --git a/jstests/noPassthrough/plan_cache_index_create.js b/jstests/noPassthrough/plan_cache_index_create.js index 0fc6c818c1a..117af56f346 100644 --- a/jstests/noPassthrough/plan_cache_index_create.js +++ b/jstests/noPassthrough/plan_cache_index_create.js @@ -62,7 +62,7 @@ function runTest({rst, readDB, writeDB}) { writeConcern: {w: "majority"} })); - rst.waitForAllIndexBuildsToFinish(dbName, collName); + rst.awaitReplication(); // // Confirm that the plan cache is reset on start and completion of a background index build. @@ -122,7 +122,7 @@ function runTest({rst, readDB, writeDB}) { assert.soon(() => !indexBuildIsRunning(readDB, "most_selective")); createIdxShell({checkExitSuccess: true}); - rst.waitForAllIndexBuildsToFinish(dbName, collName); + rst.awaitReplication(); // Confirm that there are no cached plans post index build. assertDoesNotHaveCachedPlan(readColl, filter); @@ -152,7 +152,7 @@ function runTest({rst, readDB, writeDB}) { writeConcern: {w: "majority"} })); - rst.waitForAllIndexBuildsToFinish(dbName, collName); + rst.awaitReplication(); // Confirm that there are no cached plans post index build. assertDoesNotHaveCachedPlan(readColl, filter); diff --git a/jstests/replsets/buildindexes_false_with_system_indexes.js b/jstests/replsets/buildindexes_false_with_system_indexes.js index a1f1c8d6d45..5688c2e292e 100644 --- a/jstests/replsets/buildindexes_false_with_system_indexes.js +++ b/jstests/replsets/buildindexes_false_with_system_indexes.js @@ -73,8 +73,8 @@ jsTestLog("Now restarting primary; indexes should be created."); rst.restart(primary); primary = rst.getPrimary(); rst.awaitReplication(); -rst.waitForAllIndexBuildsToFinish("admin", "system.users"); -rst.waitForAllIndexBuildsToFinish("admin", "system.roles"); +rst.awaitReplication(); +rst.awaitReplication(); adminDb = primary.getDB("admin"); assert.eq(["_id_", "user_1_db_1"], adminDb.system.users.getIndexes().map(x => x.name).sort()); assert.eq(["_id_", "role_1_db_1"], adminDb.system.roles.getIndexes().map(x => x.name).sort()); diff --git a/jstests/replsets/reindex.js b/jstests/replsets/reindex.js index b27f23b8c83..a687bc4fb57 100644 --- a/jstests/replsets/reindex.js +++ b/jstests/replsets/reindex.js @@ -29,7 +29,7 @@ assert.commandWorked(primaryColl.insert({a: 1000})); assert.commandWorked(primaryColl.ensureIndex({a: 1})); replTest.awaitReplication(); -replTest.waitForAllIndexBuildsToFinish(dbName, collName); +replTest.awaitReplication(); assert.eq(2, primaryColl.getIndexes().length, diff --git a/jstests/replsets/replset1.js b/jstests/replsets/replset1.js index 96120f960f2..e78ab801565 100644 --- a/jstests/replsets/replset1.js +++ b/jstests/replsets/replset1.js @@ -124,7 +124,7 @@ var doTest = function(signal) { t.save({a: 1000}); t.ensureIndex({a: 1}); - replTest.waitForAllIndexBuildsToFinish('foo', 'foo'); + replTest.awaitReplication(); ts.forEach(function(z) { assert.eq(2, z.getIndexKeys().length, "A " + z.getMongo()); diff --git a/jstests/replsets/secondary_as_sync_source.js b/jstests/replsets/secondary_as_sync_source.js index 33ac4b24ac0..618c7ae68c3 100644 --- a/jstests/replsets/secondary_as_sync_source.js +++ b/jstests/replsets/secondary_as_sync_source.js @@ -104,7 +104,7 @@ if (!IndexBuildTest.supportsTwoPhaseIndexBuild(primary)) { } // Wait for the index builds to finish. -replSet.waitForAllIndexBuildsToFinish(dbName, collName); +replSet.awaitReplication(); jsTest.log("Checking if the indexes match between the new node and the secondary node"); let newNodeDB = newNode.getDB(dbName); diff --git a/jstests/replsets/secondary_reads_timestamp_visibility.js b/jstests/replsets/secondary_reads_timestamp_visibility.js index 4b981b72cc8..4527a0cecab 100644 --- a/jstests/replsets/secondary_reads_timestamp_visibility.js +++ b/jstests/replsets/secondary_reads_timestamp_visibility.js @@ -36,7 +36,7 @@ for (let i = 0; i < 100; i++) { replSet.awaitLastOpCommitted(); // This function includes a call to awaitReplication(). -replSet.waitForAllIndexBuildsToFinish(primaryDB.getName(), collName); +replSet.awaitReplication(); // Sanity check. assert.eq(secondaryDB.getCollection(collName).find({x: 0}).itcount(), 100); diff --git a/jstests/replsets/text_index_limits.js b/jstests/replsets/text_index_limits.js index 5ef1fef8efb..6a1bb0294b0 100644 --- a/jstests/replsets/text_index_limits.js +++ b/jstests/replsets/text_index_limits.js @@ -17,7 +17,7 @@ var t = db.text_index_limits; t.drop(); assert.commandWorked(t.createIndex({comments: "text"})); -replTest.waitForAllIndexBuildsToFinish(t.getDB(), t.getName()); +replTest.awaitReplication(); // 1. Test number of unique terms exceeds 400,000 let commentsWithALotOfUniqueWords = ""; diff --git a/src/mongo/shell/replsettest.js b/src/mongo/shell/replsettest.js index a1f2927ba16..3838c073cf1 100644 --- a/src/mongo/shell/replsettest.js +++ b/src/mongo/shell/replsettest.js @@ -1884,10 +1884,6 @@ var ReplSetTest = function(opts) { } }; - this.waitForAllIndexBuildsToFinish = function(dbName, collName) { - this.awaitReplication(); - }; - this.getHashesUsingSessions = function(sessions, dbName, { filterCapped: filterCapped = true, readAtClusterTime, |