Invariant in PlanStage::dispose always evaluates as true

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Fixed
    • Priority: Major - P3
    • 4.4.1, 3.6.20, 4.7.0, 4.0.21
    • Affects Version/s: None
    • Component/s: Querying
    • None
    • Fully Compatible
    • ALL
    • v4.4, v4.2, v4.0, v3.6
    • Dev Platform 2020-08-24
    • None
    • 3
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      Due to a typo in the PlanStage::dispose() invariant it can never be evaluated to false.

      src/mongo/db/exec/plan_stage.h:271:62: warning: self-comparison always evaluates to true [-Wtautological-compare]
      
                  ::mongo::invariantWithLocation((!_opCtx !_opCtx || opCtx == opCtx", "src/mongo/db/exec/plan_stage.h", 271);
      

      The opCtx == opCtx condition should be opCtx == _optCtx.

      Note that there is a task SERVER-37453 to delete PlantExecutor::dispose() method and its friends, so we may not need to fix this issue if the dispose() code is being removed in next sprint.

              Assignee:
              Andrew Morrow (Inactive)
              Reporter:
              Anton Korshunov
              Votes:
              2 Vote for this issue
              Watchers:
              8 Start watching this issue

                Created:
                Updated:
                Resolved: