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

    XMLWordPrintableJSON

Details

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Major - P3 Major - P3
    • 5.0.0-rc1, 5.1.0-rc0
    • 5.0.0
    • Sharding
    • None
    • Fully Compatible
    • ALL
    • v5.0
    • Sharding EMEA 2021-05-31
    • 122

    Description

      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.

      Attachments

        Activity

          People

            tommaso.tocci@mongodb.com Tommaso Tocci
            max.hirschhorn@mongodb.com Max Hirschhorn
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: