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

Invariant in PlanStage::dispose always evaluates as true

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Major - P3 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

      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@mongodb.com Andrew Morrow (Inactive)
            Reporter:
            anton.korshunov@mongodb.com Anton Korshunov
            Votes:
            2 Vote for this issue
            Watchers:
            8 Start watching this issue

              Created:
              Updated:
              Resolved: