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

ReshardingDonorOplogIterator must call Pipeline::dispose() if Pipeline::getNext() throws

    XMLWordPrintable

    Details

    • Backwards Compatibility:
      Fully Compatible
    • Operating System:
      ALL
    • Backport Requested:
      v5.0
    • Sprint:
      Sharding 2021-06-28
    • Linked BF Score:
      150
    • Story Points:
      1

      Description

      If this call to Pipeline::getNext() throws, then it is possible for the PlanExecutor underlying the Pipeline's DocumentSourceCursor to still be holding locks while the OperationContext is destructed.

      We should add a guard around the call to ReshardingDonorOplogIterator::_fillBatch() to call Pipeline::dispose() if Pipeline::getNext() throws.

      auto guard = makeGuard([&] { pipeline->dispose(opCtx); pipeline.reset() });
      pipeline->reattachToOperationContext(opCtx);
      auto doc = pipeline->getNext();
      pipeline->detachFromOperationContext();
      guard.dismiss();
      

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              max.hirschhorn Max Hirschhorn
              Reporter:
              max.hirschhorn Max Hirschhorn
              Participants:
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: