diff options
author | Marcos José Grillo Ramirez <marcos.grillo@mongodb.com> | 2022-07-18 10:50:54 +0000 |
---|---|---|
committer | Evergreen Agent <no-reply@evergreen.mongodb.com> | 2022-07-18 11:20:56 +0000 |
commit | 6a8cc3ae1154cf24562b8f4d6b94a4c650f722ad (patch) | |
tree | 83a9bacf021cd75dfba8cea2e6aa25640459bc62 | |
parent | 1c0b948e215c7cc5e9deffe63b5faf6792f1c30a (diff) | |
download | mongo-6a8cc3ae1154cf24562b8f4d6b94a4c650f722ad.tar.gz |
SERVER-68078 Remove range deletion test regarding FCV
-rw-r--r-- | jstests/sharding/range_deletions_setFCV.js | 98 | ||||
-rw-r--r-- | src/mongo/db/commands/set_feature_compatibility_version_command.cpp | 2 |
2 files changed, 0 insertions, 100 deletions
diff --git a/jstests/sharding/range_deletions_setFCV.js b/jstests/sharding/range_deletions_setFCV.js deleted file mode 100644 index d7d19d40097..00000000000 --- a/jstests/sharding/range_deletions_setFCV.js +++ /dev/null @@ -1,98 +0,0 @@ -/** - * Tests that the range deleter updates the number of orphans from a migration with every deleted - * orphan batch while running FCV upgrade. - * - * @tags: [ - * uses_parallel_shell, - * requires_fcv_60, - * __TEMPORARILY_DISABLED__, - * ] - */ - -(function() { -'use strict'; - -load("jstests/libs/fail_point_util.js"); -load('jstests/libs/parallel_shell_helpers.js'); - -const rangeDeleterBatchSize = 128; - -const st = new ShardingTest({ - shards: 2, - other: { - shardOptions: {setParameter: {rangeDeleterBatchSize: rangeDeleterBatchSize}}, - } -}); - -// Setup database and collection for test -const dbName = 'db'; -const db = st.getDB(dbName); -assert.commandWorked( - st.s.adminCommand({enableSharding: dbName, primaryShard: st.shard0.shardName})); -const coll = db['test']; -const nss = coll.getFullName(); -assert.commandWorked(st.s.adminCommand({shardCollection: nss, key: {_id: 1}})); - -assert.commandWorked(db.adminCommand({setFeatureCompatibilityVersion: lastContinuousFCV})); - -function assertOrphanCountIsCorrectOrMissing(conn, ns, numOrphans) { - let fcv = - assert.commandWorked(conn.adminCommand({getParameter: 1, featureCompatibilityVersion: 1})); - const rangeDeletionDoc = - conn.getDB("config").getCollection("rangeDeletions").findOne({nss: ns}); - if (fcv.featureCompatibilityVersion.version === "6.0") { - assert.neq( - null, - rangeDeletionDoc, - "did not find document for namespace " + ns + - ", contents of config.rangeDeletions on " + conn + ": " + - tojson(conn.getDB("config").getCollection("rangeDeletions").find().toArray())); - assert.eq(numOrphans, - rangeDeletionDoc.numOrphanDocs, - "Incorrect count of orphaned documents in config.rangeDeletions on " + conn + - ": expected " + numOrphans + - " orphaned documents but found range deletion document " + - tojson(rangeDeletionDoc)); - } -} - -// Insert some docs into the collection. -const numDocs = 1000; -let bulk = coll.initializeUnorderedBulkOp(); -for (let i = 0; i < numDocs; i++) { - bulk.insert({_id: i}); -} -assert.commandWorked(bulk.execute()); - -// Pause before first range deletion task -let beforeDeletionFailpoint = configureFailPoint(st.shard0, "hangBeforeDoingDeletion"); -let afterDeletionFailpoint = configureFailPoint(st.shard0, "hangAfterDoingDeletion"); - -// Upgrade FCV to 6.0 -let pauseBeforeDrainingMigrations = configureFailPoint(st.shard0, "hangBeforeDrainingMigrations"); -const FCVUpgrade = startParallelShell( - funWithArgs(function(fcv) { - assert.commandWorked(db.adminCommand({setFeatureCompatibilityVersion: fcv})); - }, latestFCV), st.s.port); -pauseBeforeDrainingMigrations.wait(); -assert.commandWorked(db.adminCommand({moveChunk: nss, find: {_id: 0}, to: st.shard1.shardName})); - -pauseBeforeDrainingMigrations.off(); -// Check the batches are deleted correctly -const numBatches = numDocs / rangeDeleterBatchSize; -for (let i = 0; i < numBatches; i++) { - // Wait for failpoint and check num orphans - beforeDeletionFailpoint.wait(); - assertOrphanCountIsCorrectOrMissing(st.shard0, nss, numDocs - rangeDeleterBatchSize * i); - // Unset and reset failpoint without allowing any batches deleted in the meantime - afterDeletionFailpoint = configureFailPoint(st.shard0, "hangAfterDoingDeletion"); - beforeDeletionFailpoint.off(); - afterDeletionFailpoint.wait(); - beforeDeletionFailpoint = configureFailPoint(st.shard0, "hangBeforeDoingDeletion"); - afterDeletionFailpoint.off(); -} -beforeDeletionFailpoint.off(); - -FCVUpgrade(); -st.stop(); -})(); diff --git a/src/mongo/db/commands/set_feature_compatibility_version_command.cpp b/src/mongo/db/commands/set_feature_compatibility_version_command.cpp index 3bdd4f03141..211286e2dbd 100644 --- a/src/mongo/db/commands/set_feature_compatibility_version_command.cpp +++ b/src/mongo/db/commands/set_feature_compatibility_version_command.cpp @@ -105,7 +105,6 @@ MONGO_FAIL_POINT_DEFINE(hangWhileUpgrading); MONGO_FAIL_POINT_DEFINE(failDowngrading); MONGO_FAIL_POINT_DEFINE(hangWhileDowngrading); MONGO_FAIL_POINT_DEFINE(hangBeforeUpdatingFcvDoc); -MONGO_FAIL_POINT_DEFINE(hangBeforeDrainingMigrations); /** * Ensures that only one instance of setFeatureCompatibilityVersion can run at a given time. @@ -365,7 +364,6 @@ public: _runDowngrade(opCtx, request, changeTimestamp); } - hangBeforeDrainingMigrations.pauseWhileSet(); { // Complete transition by updating the local FCV document to the fully upgraded or // downgraded requestedVersion. |