File tree Expand file tree Collapse file tree 1 file changed +11
-1
lines changed Expand file tree Collapse file tree 1 file changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -501,6 +501,16 @@ _in_sharded_txn (const mongoc_client_session_t *session)
501
501
MONGOC_TOPOLOGY_SHARDED ;
502
502
}
503
503
504
+ static bool
505
+ _in_sharded_or_loadbalanced_txn (const mongoc_client_session_t * session )
506
+ {
507
+ return session && _mongoc_client_session_in_txn_or_ending (session ) &&
508
+ (_mongoc_topology_get_type (session -> client -> topology ) ==
509
+ MONGOC_TOPOLOGY_SHARDED ||
510
+ _mongoc_topology_get_type (session -> client -> topology ) ==
511
+ MONGOC_TOPOLOGY_LOAD_BALANCED );
512
+ }
513
+
504
514
static void
505
515
_handle_txn_error_labels (bool cmd_ret ,
506
516
const bson_error_t * cmd_err ,
@@ -655,7 +665,7 @@ mongoc_cluster_run_command_monitored (mongoc_cluster_t *cluster,
655
665
656
666
_handle_txn_error_labels (retval , error , cmd , reply );
657
667
658
- if (retval && _in_sharded_txn (cmd -> session ) &&
668
+ if (retval && _in_sharded_or_loadbalanced_txn (cmd -> session ) &&
659
669
bson_iter_init_find (& iter , reply , "recoveryToken" )) {
660
670
bson_destroy (cmd -> session -> recovery_token );
661
671
if (BSON_ITER_HOLDS_DOCUMENT (& iter )) {
You can’t perform that action at this time.
0 commit comments