summaryrefslogtreecommitdiff
path: root/src/mongo/db/cluster_transaction_api.h
diff options
context:
space:
mode:
authorJack Mulrow <jack.mulrow@mongodb.com>2022-05-11 21:56:30 +0000
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2022-05-11 22:35:37 +0000
commit51bff7a1d0145afebb57a04e82bd962985801f06 (patch)
tree6611155dfc0b22a611a0c5095f37b785a2b1ddb4 /src/mongo/db/cluster_transaction_api.h
parent81fa710687e399d7aa2bd093987396c6f6a36956 (diff)
downloadmongo-51bff7a1d0145afebb57a04e82bd962985801f06.tar.gz
SERVER-66388 Disallow using transaction API in operations with shard versions
Diffstat (limited to 'src/mongo/db/cluster_transaction_api.h')
-rw-r--r--src/mongo/db/cluster_transaction_api.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/mongo/db/cluster_transaction_api.h b/src/mongo/db/cluster_transaction_api.h
index 45135cde65d..254b38791bc 100644
--- a/src/mongo/db/cluster_transaction_api.h
+++ b/src/mongo/db/cluster_transaction_api.h
@@ -46,6 +46,12 @@ public:
Future<DbResponse> handleRequest(OperationContext* opCtx,
const Message& request) const override;
+
+ bool canRunInShardedOperations() const {
+ // Cluster commands will attach appropriate shard versions for any targeted namespaces, so
+ // it is safe to use this client within a caller's operation with shard versions.
+ return true;
+ }
};
} // namespace mongo::txn_api::details