Uploaded image for project: 'C# Driver'
  1. C# Driver
  2. CSHARP-3048

RetryableWrites are only supported if session Id has a value

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 2.10.4
    • Affects Version/s: 2.10.3
    • Component/s: Write Operations
    • None
    • 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:

      1. It determines sessions are not supported because some mongos instances are missing 'LogicalSessionTimeoutMinutes` and will not include an "lsid" in the command
      2. 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.

       

            Assignee:
            robert@mongodb.com Robert Stam
            Reporter:
            robert@mongodb.com Robert Stam
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: