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

Invariant that operations which are holding open an oplog hole cannot block when acquiring locks

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 5.1.0-rc0
    • Component/s: None
    • Labels:
      None
    • Backwards Compatibility:
      Fully Compatible
    • Sprint:
      Execution Team 2021-06-28, Execution Team 2021-07-12, Execution Team 2021-07-26

      Description

      SERVER-46698 invariants that operations which are holding open an oplog hole cannot acquire a storage engine ticket or flow control ticket.

      We also attempted to invariant when acquiring a lock, namely in LockerImpl::_lockBegin and LockerImpl::_lockComplete, but discovered that a MODE_IX lock on the session transactions table is acquired while holding open an oplog hole in at least two different code paths.

      1. In logApplyOpsForTransaction, an oplog hole is opened (via RecoveryUnit::setTimestamp) by logOperation. A MODE_IX lock on the session transactions table is then acquired here by onWriteOpCompleted (via updateSessionEntry in onWriteOpCompletedOnPrimary).
      2. In OpObserverImpl::onInserts, an oplog hole is opened by repl::logInsertOps. A MODE_IX lock on the session transactions table is then acquired here by onWriteOpCompleted (via updateSessionEntry in onWriteOpCompletedOnPrimary).

      The goal of this ticket should be to (a) determine whether acquiring the MODE_IX lock on the session transactions table can actually block in practice (perhaps another thread acquires a MODE_X or MODE_S lock on the session transactions table) and to (b) invariant that operations which are holding open an oplog hole cannot block when acquiring locks.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              gregory.wlodarek Gregory Wlodarek
              Reporter:
              james.heppenstall James Heppenstall
              Participants:
              Votes:
              1 Vote for this issue
              Watchers:
              8 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: