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

In GetMoreCmd, guard getTransactionOperationsForTest with test on TransactionParticipant

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 8.0.0-rc11
    • Affects Version/s: None
    • Component/s: None
    • None
    • Cluster Scalability
    • Fully Compatible
    • ALL
    • v8.0
    • Cluster Scalability 2024-07-08
    • 200

      There is an invariant in GetMoreCmd that enforces that getMore in a transaction does not perform any writes. This invariant relies on opCtx->inMultiDocumentTransaction() to guard the check; however, there is a possibility that an operation context is in a multi-document transaction but does not have a TransactionParticipant (which is what we're using to count write operations). Specifically, the TransactionParticipant could have been stashed. In this case, we don't need to check this invariant.

      Furthermore, this function getTransactionOperationsForTest() should be renamed since we're not just calling it for tests.

            Assignee:
            israel.hsu@mongodb.com Israel Hsu
            Reporter:
            israel.hsu@mongodb.com Israel Hsu
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: