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

Make AsyncRequestSender not retry remote command requests with startTransaction=true

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 4.4.1, 4.7.0
    • Component/s: Sharding
    • Labels:
      None
    • Backwards Compatibility:
      Fully Compatible
    • Operating System:
      ALL
    • Backport Requested:
      v4.4
    • Sprint:
      Sharding 2020-07-13, Sharding 2020-07-27
    • Linked BF Score:
      26

      Description

      The AsyncRequestSender can retry a remote command request on retriable errors up to kMaxNumFailedHostRetryAttempts times. Based on BF-17754, it is not safe for the ARS to retry remote commands that are run inside transactions since it can lead to a crash in the following case:

      1. There is an unprepared transaction that gets aborted by the RstlKillOpThread on stepdown and the command fails with InterruptedDueToReplStateChange.
      2. The ARS retries the remote command request for that transaction statement (with startTransaction: true) against the new primary and the transaction gets committed with two-phase commit.
      3. The transaction state in the old primary’s TransactionParticipant is still AbortedWithoutPrepare when the oplog entry for prepare gets replicated to the old primary so the transaction state assertion here fails and the op applier fails this fatal assertion.

      So the ARS should check to see if the operation with startTransaction=true and not retry if it is. There is already a rough CR patch for testing this case. 

       

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              luis.osta Luis Osta Lugo (Inactive)
              Reporter:
              cheahuychou.mao Cheahuychou Mao
              Participants:
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: