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

Remove support for applyOps command preCondition field

    • Type: Icon: Improvement Improvement
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 6.2.0-rc0
    • Affects Version/s: None
    • Component/s: None
    • None
    • Minor Change
    • QE 2022-09-19

      The applyOps command currently supports a "preCondition" field. However, this is no longer used by any of our tools and should be removed.

      TheĀ "preCondition" field consists of an array of query predicates and corresponding match expressions. When applyOps runs, the system internally runs findOne queries and verifies that the resulting documents match the paired match expressions. Aside from the fact that "preCondition" is no longer used, a good reason to delete the code is that the q field within each individual condition describes the query as though it were an OP_QUERY wire protocol message. We removed support for OP_QUERY in 5.1 and deleted most of the code. However, supporting the q field of each precondition requires us to keep some ancient query parsing code from the days of OP_QUERY around – and this is code that is not used in the normal query processing path.

      The work for this ticket is to double-check that no tools are relying on "preCondition" anymore, and then to delete the code for it. It's possible that this will permit deletion of some OP_QUERY-related code as well, so please check with the Query Team about this when this ticket is completed.

            Assignee:
            david.storch@mongodb.com David Storch
            Reporter:
            david.storch@mongodb.com David Storch
            Votes:
            1 Vote for this issue
            Watchers:
            8 Start watching this issue

              Created:
              Updated:
              Resolved: