summaryrefslogtreecommitdiff
path: root/src/mongo/db/s/transaction_coordinator_test.cpp
diff options
context:
space:
mode:
authorA. Jesse Jiryu Davis <jesse@mongodb.com>2021-05-04 19:29:17 -0400
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2021-05-13 17:48:10 +0000
commit500a405a5ce235507f56fb47e8d5d4b368d3458d (patch)
treeeecb1020c3049a816d28ffd5461b8d3ecab8686a /src/mongo/db/s/transaction_coordinator_test.cpp
parent2070fc76b3604f8c04997862159b0fc721eeb465 (diff)
downloadmongo-500a405a5ce235507f56fb47e8d5d4b368d3458d.tar.gz
SERVER-56550 Require consistent API params in getMore and txns
Transaction-continuing commands must use the same API parameters as the transaction's first command (it is no longer optional), and similarly getMore must use the same as the cursor-creating command.
Diffstat (limited to 'src/mongo/db/s/transaction_coordinator_test.cpp')
-rw-r--r--src/mongo/db/s/transaction_coordinator_test.cpp24
1 files changed, 16 insertions, 8 deletions
diff --git a/src/mongo/db/s/transaction_coordinator_test.cpp b/src/mongo/db/s/transaction_coordinator_test.cpp
index 42a4da83b4c..5b060c8d968 100644
--- a/src/mongo/db/s/transaction_coordinator_test.cpp
+++ b/src/mongo/db/s/transaction_coordinator_test.cpp
@@ -409,7 +409,8 @@ TEST_F(TransactionCoordinatorDriverTest,
TEST_F(TransactionCoordinatorDriverTest,
SendPrepareReturnsAbortDecisionWhenFirstParticipantVotesAbortAndSecondVotesCommit) {
txn::AsyncWorkScheduler aws(getServiceContext());
- auto future = txn::sendPrepare(getServiceContext(), aws, _lsid, _txnNumber, kTwoShardIdList);
+ auto future = txn::sendPrepare(
+ getServiceContext(), aws, _lsid, _txnNumber, APIParameters(), kTwoShardIdList);
onCommands({[&](const executor::RemoteCommandRequest& request) { return kNoSuchTransaction; },
[&](const executor::RemoteCommandRequest& request) { return kPrepareOk; }});
@@ -424,7 +425,8 @@ TEST_F(TransactionCoordinatorDriverTest,
TEST_F(TransactionCoordinatorDriverTest,
SendPrepareReturnsAbortDecisionWhenFirstParticipantVotesCommitAndSecondVotesAbort) {
txn::AsyncWorkScheduler aws(getServiceContext());
- auto future = txn::sendPrepare(getServiceContext(), aws, _lsid, _txnNumber, kTwoShardIdList);
+ auto future = txn::sendPrepare(
+ getServiceContext(), aws, _lsid, _txnNumber, APIParameters(), kTwoShardIdList);
assertPrepareSentAndRespondWithSuccess();
assertPrepareSentAndRespondWithNoSuchTransaction();
@@ -438,7 +440,8 @@ TEST_F(TransactionCoordinatorDriverTest,
TEST_F(TransactionCoordinatorDriverTest,
SendPrepareReturnsAbortDecisionWhenBothParticipantsVoteAbort) {
txn::AsyncWorkScheduler aws(getServiceContext());
- auto future = txn::sendPrepare(getServiceContext(), aws, _lsid, _txnNumber, kTwoShardIdList);
+ auto future = txn::sendPrepare(
+ getServiceContext(), aws, _lsid, _txnNumber, APIParameters(), kTwoShardIdList);
onCommands({[&](const executor::RemoteCommandRequest& request) { return kNoSuchTransaction; },
[&](const executor::RemoteCommandRequest& request) { return kNoSuchTransaction; }});
@@ -455,7 +458,8 @@ TEST_F(TransactionCoordinatorDriverTest,
const auto maxPrepareTimestamp = Timestamp(2, 1);
txn::AsyncWorkScheduler aws(getServiceContext());
- auto future = txn::sendPrepare(getServiceContext(), aws, _lsid, _txnNumber, kTwoShardIdList);
+ auto future = txn::sendPrepare(
+ getServiceContext(), aws, _lsid, _txnNumber, APIParameters(), kTwoShardIdList);
assertPrepareSentAndRespondWithSuccess(firstPrepareTimestamp);
assertPrepareSentAndRespondWithSuccess(maxPrepareTimestamp);
@@ -472,7 +476,8 @@ TEST_F(TransactionCoordinatorDriverTest,
const auto maxPrepareTimestamp = Timestamp(2, 1);
txn::AsyncWorkScheduler aws(getServiceContext());
- auto future = txn::sendPrepare(getServiceContext(), aws, _lsid, _txnNumber, kTwoShardIdList);
+ auto future = txn::sendPrepare(
+ getServiceContext(), aws, _lsid, _txnNumber, APIParameters(), kTwoShardIdList);
assertPrepareSentAndRespondWithSuccess(maxPrepareTimestamp);
assertPrepareSentAndRespondWithSuccess(firstPrepareTimestamp);
@@ -489,7 +494,8 @@ TEST_F(TransactionCoordinatorDriverTest,
const auto maxPrepareTimestamp = Timestamp(2, 1);
txn::AsyncWorkScheduler aws(getServiceContext());
- auto future = txn::sendPrepare(getServiceContext(), aws, _lsid, _txnNumber, kTwoShardIdList);
+ auto future = txn::sendPrepare(
+ getServiceContext(), aws, _lsid, _txnNumber, APIParameters(), kTwoShardIdList);
assertPrepareSentAndRespondWithSuccess(firstPrepareTimestamp);
assertPrepareSentAndRespondWithSuccess(maxPrepareTimestamp);
@@ -505,7 +511,8 @@ TEST_F(TransactionCoordinatorDriverTest,
const auto timestamp = Timestamp(1, 1);
txn::AsyncWorkScheduler aws(getServiceContext());
- auto future = txn::sendPrepare(getServiceContext(), aws, _lsid, _txnNumber, kTwoShardIdList);
+ auto future = txn::sendPrepare(
+ getServiceContext(), aws, _lsid, _txnNumber, APIParameters(), kTwoShardIdList);
assertPrepareSentAndRespondWithSuccess(timestamp);
assertCommandSentAndRespondWith(
@@ -521,7 +528,8 @@ TEST_F(TransactionCoordinatorDriverTest,
TEST_F(TransactionCoordinatorDriverTest,
SendPrepareReturnsErrorWhenOneShardReturnsReadConcernMajorityNotEnabled) {
txn::AsyncWorkScheduler aws(getServiceContext());
- auto future = txn::sendPrepare(getServiceContext(), aws, _lsid, _txnNumber, kTwoShardIdList);
+ auto future = txn::sendPrepare(
+ getServiceContext(), aws, _lsid, _txnNumber, APIParameters(), kTwoShardIdList);
assertPrepareSentAndRespondWithSuccess(Timestamp(100, 1));
assertCommandSentAndRespondWith(