-
Type: Bug
-
Resolution: Fixed
-
Priority: Unknown
-
Affects Version/s: None
-
Component/s: Transactions
-
None
Summary
By design, libmongoc does not pin sessions for transactions executed against a load balanced topology. This is because clients are pooled instead of connections, and each client only maintains a single socket per server (one for the case of a load balancer).
Although the rules for pinning in load balancer mode may not apply, rules for the recoveryToken field should apply to both sharded and load balanced topologies. When connected to a load balancer, libmongoc does not appear to ever send a recoveryToken field in outgoing commitTransaction or abortTransaction commands. This was observed when testing the PHP driver with legacy transaction spec tests, which were recently modified to add "load-balanced" to the list of supported topologies for runOn requirements (DRIVERS-2713).
According to kevin.albertson@mongodb.com, libmongoc's current behavior is:
- recoveryToken is sent if it was previously stored.
- Storing recoveryToken requires _in_sharded_txn() be true.
- being true requires topology type MONGOC_TOPOLOGY_SHARDED (not MONGOC_TOPOLOGY_LOAD_BALANCED)
This may be indicative of a bug.
- is related to
-
DRIVERS-2713 Permit legacy transaction tests to run on load-balanced topologies and Atlas Serverless
- Closed
- related to
-
PHPLIB-1228 Permit legacy transaction tests to run on load-balanced topologies and Atlas Serverless
- Closed