Uploaded image for project: 'Documentation'
  1. Documentation
  2. DOCS-14214

Investigate changes in SERVER-54299: Mark OrMatchExpression::matchesSingleElement as dead code

    XMLWordPrintable

    Details

    • Type: Task
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Works as Designed
    • Affects Version/s: None
    • Fix Version/s: 4.9.0
    • Component/s: manual, Server
    • Labels:
      None

      Description

      Description

      Downstream Change Summary

      We have marked one of the methods related to $or operator as dead code. We are certain that no user query can lead to the execution of this method, so this change should not impact anything.
      Still, we would like other teams to be informed just in case.

      Description of Linked Ticket

      During the discussion of SERVER-52914, we have noticed that OrMatchExpression::matchesSingleElement has a different handling of MatchDetails object compared to OrMatchExpression::matches. During the investigation we have started to wonder if this method ever gets called. It looks like query parser simply does not allow a query where this method would be called.

      Our coverage report for July 2019 says that this method is not covered by tests. Recent Evergreen patch where this method was replaced with MONGO_UNREACHABLE passes without any failures.

      It is highly unlikely that our tests do not cover some case where OrMatchExpression::matchesSingleElement is used, so we concluded that this is a dead code. We should replace the body of this method with MONGO_UNREACHABLE_TASSERT to avoid further confusion.

      Scope of changes

      Impact to Other Docs

      MVP (Work and Date)

      Resources (Scope or Design Docs, Invision, etc.)

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              Unassigned Unassigned
              Reporter:
              backlog-server-pm Backlog - Core Eng Program Management Team
              Participants:
              Last commenter:
              Jeffrey Allen Jeffrey Allen
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Days since reply:
                9 weeks, 6 days ago