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

Invariant in PlanStage::dispose always evaluates as true

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 4.4.1, 3.6.20, 4.7.0, 4.0.21
    • Component/s: Querying
    • Labels:
      None
    • Backwards Compatibility:
      Fully Compatible
    • Operating System:
      ALL
    • Backport Requested:
      v4.4, v4.2, v4.0, v3.6
    • Sprint:
      Dev Platform 2020-08-24

      Description

      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.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              acm Andrew Morrow
              Reporter:
              anton.korshunov Anton Korshunov
              Participants:
              Votes:
              2 Vote for this issue
              Watchers:
              9 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: