Reconcile how PrimaryOnlyService::lookupInstance() expects opCtx holding locks to be tagged as always interruptible

XMLWordPrintableJSON

    • Fully Compatible
    • Sharding 2020-10-19
    • 14
    • None
    • 3
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      // If this operation is holding any database locks, then it must have opted into getting
      // interrupted at stepdown to prevent deadlocks.
      invariant(!opCtx->lockState()->isLocked() || opCtx->shouldAlwaysInterruptAtStepDownOrUp());
      

      OperationContext::setAlwaysInterruptAtStepDownOrUp() isn't called in the write command codepath and so the invariant in PrimaryOnlyService::lookupInstance() would get triggered. However, those operations are still interruptible at stepdown because they'll have acquire the global IX lock.

              Assignee:
              Max Hirschhorn
              Reporter:
              Blake Oler
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Created:
                Updated:
                Resolved: