-
Type: Bug
-
Resolution: Fixed
-
Priority: Major - P3
-
Affects Version/s: 2.10.3
-
Component/s: Write Operations
-
None
-
(copied to CRM)
-
Fully Compatible
Certain server versions have an issue that can result in some mongos instances reporting a value for `LogicalSessionTimeoutMinutes` in the `isMaster` reply while other instances of mongos do not.
The C# driver currently assumes that all mongos instances would be consistent in either reporting or not reporting a value for `LogicalSessionTimeoutMinutes`.
When some mongos instances report a `LogicalSessionTimeoutMinutes` and some don't the driver gets confused and retryable writes fail because:
- It determines sessions are not supported because some mongos instances are missing 'LogicalSessionTimeoutMinutes` and will not include an "lsid" in the command
- But if a write operation is the routed to a mongos that does report `LogicalSessionTimeoutMinutes` it will conclude that retryable writes are suported and will include a "txnNumber" in the command
This results in an error from the server:
Command insert failed: Transaction number requires a sessionId to be specified.
The C# driver needs to workaround this server anomaly by verifying that session Id has a value before attempting a retryable write.