Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-57051

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

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Major - P3 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

      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@mongodb.com Tommaso Tocci
            Reporter:
            max.hirschhorn@mongodb.com Max Hirschhorn
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: