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

[Retryability] Make transaction participants throw RetryableTransactionInProgress if a retry arrives while the transaction has not been committed or aborted

    • Type: Icon: Task Task
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 5.3.0
    • Affects Version/s: None
    • Component/s: None
    • None
    • Fully Compatible
    • Sharding 2022-01-10, Sharding 2022-01-24, Sharding 2022-02-07
    • 3

      This is to handle the case where the external client retries retryable writes that are being executed using internal transactions. This is from the design:

      To support such retries but avoid executing write statements within a retryable internal transaction more than once, upon seeing a startTransaction statement for a new internal transaction, a transaction participant will also check if there is an existing in-progress internal transaction for the write command that the new transaction corresponds to. If there is, it will throw a RetryableTransactionInProgress error. The error will be caught and cause the startTransaction statement to block until the existing transaction commits or aborts. If the existing transaction commits, a RetryableTransactionCommitted error will be thrown and the mongos will retry the transaction (with the original txnRetryCounter) to retrieve the original response. If the existing transaction aborts, a NoSuchTransaction will be thrown and the mongos will retry the transaction (with a higher txnRetryCounter).

            Assignee:
            cheahuychou.mao@mongodb.com Cheahuychou Mao
            Reporter:
            cheahuychou.mao@mongodb.com Cheahuychou Mao
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: