Shard may fail to notify that router was stale for command in multi-statement transaction

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Fixed
    • Priority: Major - P3
    • 5.0.0-rc1, 5.1.0-rc0
    • Affects Version/s: 5.0.0
    • Component/s: Sharding
    • None
    • Fully Compatible
    • ALL
    • v5.0
    • Sharding EMEA 2021-05-31
    • 122
    • None
    • 3
    • None
    • None
    • None
    • None
    • None
    • None

      The retried call to _commandExec() may cause a shard to return a NoSuchTransaction error response instead of its original StaleShardVersionError error response despite the router having been stale. Masking the original StaleConfig exception this way prevents the router from ever finding out it was stale. This behavior can lead a multi-statement transaction to perpetually be retried by the client and never succeed until the mongos refreshes for some other reason.

      The calls to _commandExec() should be guarded by !opCtx->inMultiDocumentTransaction() similar to what was done for ShardCannotRefreshDueToLocksHeld.

            Assignee:
            Tommaso Tocci
            Reporter:
            Max Hirschhorn
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: