summaryrefslogtreecommitdiff
path: root/jstests/serverless
diff options
context:
space:
mode:
authorChristopher Caplinger <christopher.caplinger@mongodb.com>2023-04-03 16:19:25 +0000
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2023-04-03 20:07:20 +0000
commit4cf9b7381438a3abacafc7f92cdaf112b2146d81 (patch)
tree0beeb55fc3c2cd4ff73a1b1affa86c9ab382fd9c /jstests/serverless
parentb69f40cdc99b54f59de2bbeddf5624e2f33ed8f6 (diff)
downloadmongo-4cf9b7381438a3abacafc7f92cdaf112b2146d81.tar.gz
SERVER-74339: Abort Shard Split explicitly to test recovery
Diffstat (limited to 'jstests/serverless')
-rw-r--r--jstests/serverless/shard_split_startup_recovery_aborted.js15
1 files changed, 9 insertions, 6 deletions
diff --git a/jstests/serverless/shard_split_startup_recovery_aborted.js b/jstests/serverless/shard_split_startup_recovery_aborted.js
index a583f82935e..8f741f7ef49 100644
--- a/jstests/serverless/shard_split_startup_recovery_aborted.js
+++ b/jstests/serverless/shard_split_startup_recovery_aborted.js
@@ -1,7 +1,7 @@
/**
- * Commits a shard split and abort it due to timeout prior to marking it for garbage collection and
- * checks that we recover the tenant access blockers since the split is aborted but not marked as
- * garbage collectable. Checks that `abortOpTime` and `blockOpTime` are set.
+ * Commits a shard split and aborts it prior to marking it for garbage collection and checks that we
+ * recover the tenant access blockers since the split is aborted but not marked as garbage
+ * collectable. Checks that `abortOpTime` and `blockOpTime` are set.
* @tags: [requires_fcv_63, serverless]
*/
@@ -22,7 +22,6 @@ const test = new ShardSplitTest({
nodeOptions: {
setParameter: {
"failpoint.PrimaryOnlyServiceSkipRebuildingInstances": tojson({mode: "alwaysOn"}),
- "shardSplitTimeoutMS": 1000
}
}
});
@@ -31,12 +30,16 @@ test.addRecipientNodes();
let donorPrimary = test.donor.getPrimary();
// Pause the shard split before waiting to mark the doc for garbage collection.
-let fp = configureFailPoint(donorPrimary.getDB("admin"), "pauseShardSplitAfterBlocking");
+const fp = configureFailPoint(donorPrimary.getDB("admin"), "pauseShardSplitAfterBlocking");
const tenantIds = [ObjectId(), ObjectId()];
const operation = test.createSplitOperation(tenantIds);
-assert.commandFailed(operation.commit());
+const commitThread = operation.commitAsync();
fp.wait();
+assert.commandWorked(operation.abort());
+fp.off();
+commitThread.join();
+assert.commandFailed(commitThread.returnData());
assertMigrationState(donorPrimary, operation.migrationId, "aborted");