summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/mongo/db/transaction_coordinator_commands_impl.cpp10
-rw-r--r--src/mongo/db/transaction_coordinator_commands_impl_test.cpp7
2 files changed, 6 insertions, 11 deletions
diff --git a/src/mongo/db/transaction_coordinator_commands_impl.cpp b/src/mongo/db/transaction_coordinator_commands_impl.cpp
index 7fb462b1490..f1d7847f6dd 100644
--- a/src/mongo/db/transaction_coordinator_commands_impl.cpp
+++ b/src/mongo/db/transaction_coordinator_commands_impl.cpp
@@ -47,9 +47,7 @@ std::vector<ShardId> sendCommit(OperationContext* opCtx, std::set<ShardId>& nonA
std::vector<AsyncRequestsSender::Request> requests;
for (const auto& shardId : nonAckedParticipants) {
// TODO (SERVER-36584): Use the commitTransaction IDL to create the command BSON.
- requests.emplace_back(shardId,
- BSON("commitTransaction" << 1 << "$db"
- << "admin"));
+ requests.emplace_back(shardId, BSON("commitTransaction" << 1));
}
// TODO (SERVER-36638): Change to arbitrary task executor? Unit test only supports fixed
@@ -76,10 +74,8 @@ std::vector<ShardId> sendCommit(OperationContext* opCtx, std::set<ShardId>& nonA
std::vector<ShardId> sendAbort(OperationContext* opCtx, std::set<ShardId>& nonAckedParticipants) {
std::vector<AsyncRequestsSender::Request> requests;
for (const auto& shardId : nonAckedParticipants) {
- // TODO Use IDL to create command BSON.
- requests.emplace_back(shardId,
- BSON("abortTransaction" << 1 << "$db"
- << "admin"));
+ // TODO (SERVER-36584) Use IDL to create command BSON.
+ requests.emplace_back(shardId, BSON("abortTransaction" << 1));
}
// TODO (SERVER-36638): Change to arbitrary task executor? Unit test only supports fixed
diff --git a/src/mongo/db/transaction_coordinator_commands_impl_test.cpp b/src/mongo/db/transaction_coordinator_commands_impl_test.cpp
index 4b050c303ca..810ebdd5234 100644
--- a/src/mongo/db/transaction_coordinator_commands_impl_test.cpp
+++ b/src/mongo/db/transaction_coordinator_commands_impl_test.cpp
@@ -154,8 +154,8 @@ protected:
void expectSendCommitAndReturnRetryableError() {
for (int i = 0; i <= kMaxNumFailedHostRetryAttempts; i++) {
onCommand([](const executor::RemoteCommandRequest& request) -> Status {
- IDLParserErrorContext ctx("expectSendCommitAndReturnRetryableError");
- const auto cmd = CommitTransaction::parse(ctx, request.cmdObj);
+ ASSERT_EQUALS("commitTransaction",
+ request.cmdObj.firstElement().fieldNameStringData());
return {ErrorCodes::HostUnreachable, ""};
});
}
@@ -163,8 +163,7 @@ protected:
void expectSendCommitAndReturnSuccess() {
onCommand([](const executor::RemoteCommandRequest& request) {
- const IDLParserErrorContext ctx("expectSendCommitAndReturnSuccess");
- const auto cmd = CommitTransaction::parse(ctx, request.cmdObj);
+ ASSERT_EQUALS("commitTransaction", request.cmdObj.firstElement().fieldNameStringData());
return BSON("ok" << 1);
});
}