diff options
author | Cheahuychou Mao <mao.cheahuychou@gmail.com> | 2022-03-07 01:19:25 +0000 |
---|---|---|
committer | Evergreen Agent <no-reply@evergreen.mongodb.com> | 2022-03-07 03:31:00 +0000 |
commit | a58a5f5b7c1e8b64ef3b1cbbd8f4cdc34facdda7 (patch) | |
tree | 4d707bb54a678b9b3065f43d2ce414ae3d294021 | |
parent | 532103cfd11eaf41736a2fb5054e6ff655301da9 (diff) | |
download | mongo-a58a5f5b7c1e8b64ef3b1cbbd8f4cdc34facdda7.tar.gz |
SERVER-63441 Add test coverage for aborted internal transactions for non-retryable writes
-rw-r--r-- | jstests/sharding/internal_transactions_for_non_retryable_writes_before_resharding.js (renamed from jstests/sharding/internal_transactions_for_non_retryable_writes_before_and_during_resharding.js) | 8 | ||||
-rw-r--r-- | jstests/sharding/internal_transactions_for_non_retryable_writes_during_resharding.js | 28 | ||||
-rw-r--r-- | jstests/sharding/internal_transactions_for_retryable_insert_update_delete_aborted_before_resharding.js | 3 | ||||
-rw-r--r-- | jstests/sharding/internal_transactions_for_retryable_insert_update_delete_committed_before_resharding.js | 3 |
4 files changed, 34 insertions, 8 deletions
diff --git a/jstests/sharding/internal_transactions_for_non_retryable_writes_before_and_during_resharding.js b/jstests/sharding/internal_transactions_for_non_retryable_writes_before_resharding.js index 189d04a5373..8e68f1fcf2c 100644 --- a/jstests/sharding/internal_transactions_for_non_retryable_writes_before_and_during_resharding.js +++ b/jstests/sharding/internal_transactions_for_non_retryable_writes_before_resharding.js @@ -1,6 +1,6 @@ /** * Tests that resharding does not transfer the history for non-retryable internal transactions that - * commit or abort on the donor(s) before or during resharding to the recipient. + * commit or abort on the donor(s) before resharding to the recipient. * * TODO (SERVER-63877): Determine if resharding should migrate internal sessions for non-retryable * writes. @@ -15,14 +15,14 @@ load("jstests/sharding/libs/internal_transaction_resharding_test.js"); { const transactionTest = new InternalTransactionReshardingTest({reshardInPlace: false}); transactionTest.runTestForInsertUpdateDeleteBeforeResharding( - transactionTest.InternalTxnType.kNonRetryable); + transactionTest.InternalTxnType.kNonRetryable, false /* abortOnInitialTry */); transactionTest.stop(); } { const transactionTest = new InternalTransactionReshardingTest({reshardInPlace: false}); - transactionTest.runTestForInsertUpdateDeleteDuringResharding( - transactionTest.InternalTxnType.kNonRetryable); + transactionTest.runTestForInsertUpdateDeleteBeforeResharding( + transactionTest.InternalTxnType.kNonRetryable, true /* abortOnInitialTry */); transactionTest.stop(); } })(); diff --git a/jstests/sharding/internal_transactions_for_non_retryable_writes_during_resharding.js b/jstests/sharding/internal_transactions_for_non_retryable_writes_during_resharding.js new file mode 100644 index 00000000000..5e7ee8237bd --- /dev/null +++ b/jstests/sharding/internal_transactions_for_non_retryable_writes_during_resharding.js @@ -0,0 +1,28 @@ +/** + * Tests that resharding does not transfer the history for non-retryable internal transactions that + * commit or abort on the donor(s) during resharding to the recipient. + * + * TODO (SERVER-63877): Determine if resharding should migrate internal sessions for non-retryable + * writes. + * + * @tags: [requires_fcv_53, featureFlagInternalTransactions] + */ +(function() { +"use strict"; + +load("jstests/sharding/libs/internal_transaction_resharding_test.js"); + +{ + const transactionTest = new InternalTransactionReshardingTest({reshardInPlace: false}); + transactionTest.runTestForInsertUpdateDeleteDuringResharding( + transactionTest.InternalTxnType.kNonRetryable, false /* abortOnInitialTry */); + transactionTest.stop(); +} + +{ + const transactionTest = new InternalTransactionReshardingTest({reshardInPlace: false}); + transactionTest.runTestForInsertUpdateDeleteDuringResharding( + transactionTest.InternalTxnType.kNonRetryable, true /* abortOnInitialTry */); + transactionTest.stop(); +} +})(); diff --git a/jstests/sharding/internal_transactions_for_retryable_insert_update_delete_aborted_before_resharding.js b/jstests/sharding/internal_transactions_for_retryable_insert_update_delete_aborted_before_resharding.js index f0e17eb29e1..ad5347f851c 100644 --- a/jstests/sharding/internal_transactions_for_retryable_insert_update_delete_aborted_before_resharding.js +++ b/jstests/sharding/internal_transactions_for_retryable_insert_update_delete_aborted_before_resharding.js @@ -11,8 +11,7 @@ load("jstests/sharding/libs/internal_transaction_resharding_test.js"); const transactionTest = new InternalTransactionReshardingTest({reshardInPlace: false}); -const abortOnInitialTry = true; transactionTest.runTestForInsertUpdateDeleteBeforeResharding( - transactionTest.InternalTxnType.kRetryable, abortOnInitialTry); + transactionTest.InternalTxnType.kRetryable, true /* abortOnInitialTry */); transactionTest.stop(); })(); diff --git a/jstests/sharding/internal_transactions_for_retryable_insert_update_delete_committed_before_resharding.js b/jstests/sharding/internal_transactions_for_retryable_insert_update_delete_committed_before_resharding.js index 56d8068afc9..b921f9a0050 100644 --- a/jstests/sharding/internal_transactions_for_retryable_insert_update_delete_committed_before_resharding.js +++ b/jstests/sharding/internal_transactions_for_retryable_insert_update_delete_committed_before_resharding.js @@ -11,8 +11,7 @@ load("jstests/sharding/libs/internal_transaction_resharding_test.js"); const transactionTest = new InternalTransactionReshardingTest({reshardInPlace: false}); -const abortOnInitialTry = false; transactionTest.runTestForInsertUpdateDeleteBeforeResharding( - transactionTest.InternalTxnType.kRetryable, abortOnInitialTry); + transactionTest.InternalTxnType.kRetryable, false /* abortOnInitialTry */); transactionTest.stop(); })(); |