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

OperationContext::inMultiDocumentTransaction() doesn't return true when applying operations for prepared transaction during recovery

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 4.2.1, 4.3.1
    • Component/s: Replication
    • Labels:
      None
    • Backwards Compatibility:
      Fully Compatible
    • Operating System:
      ALL
    • Backport Requested:
      v4.2
    • Sprint:
      Repl 2019-09-09, Repl 2019-09-23
    • Linked BF Score:
      12

      Description

      When we reconstruct prepared transactions during replication recovery, we do not explicitly call OperationContext::setInMultiDocumentTransaction(), which means that OperationContext::inMultiDocumentTransaction() will return false. This has implications for multikey writes that are done inside a prepared transaction that is being reconstructed. When we set an index to be multikey, we expect this check to tell us whether we are inside a transaction and, as a result, need to do the multikey write in a side transaction. If we do not do the write in a side transaction, the multikey write can generate prepare conflicts on the catalog object, which is undesired. The simplest way to address this may be to just call OperationContext::setInMultiDocumentTransaction() explicitly before applying a prepared transaction during recovery.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              siyuan.zhou Siyuan Zhou
              Reporter:
              william.schultz William Schultz (Inactive)
              Participants:
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: