[SERVER-67116] Remove support for applyOps command preCondition field Created: 08/Jun/22  Updated: 29/Oct/23  Resolved: 14/Sep/22

Status: Closed
Project: Core Server
Component/s: None
Affects Version/s: None
Fix Version/s: 6.2.0-rc0

Type: Improvement Priority: Major - P3
Reporter: David Storch Assignee: David Storch
Resolution: Fixed Votes: 1
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
is depended on by COMPASS-6129 Investigate changes in SERVER-67116: ... Closed
is depended on by TOOLS-3196 Investigate changes in SERVER-67116: ... Closed
Related
related to SERVER-65955 Shell's special query path for exhaus... Closed
Backwards Compatibility: Minor Change
Sprint: QE 2022-09-19
Participants:

 Description   

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.



 Comments   
Comment by Githook User [ 14/Sep/22 ]

Author:

{'name': 'David Storch', 'email': 'david.storch@mongodb.com', 'username': 'dstorch'}

Message: SERVER-67116 Remove support for 'preCondition' from applyOps command
Branch: master
https://github.com/mongodb/mongo/commit/f599ca57cd8476c88428a53b2d844fde0afbce5e

Comment by Louis Williams [ 13/Sep/22 ]

Sounds good to me

Comment by David Storch [ 12/Sep/22 ]

louis.williams@mongodb.com I'm starting on this work now. I think to keep the patches simpler it makes sense to do this in two steps. We can get rid of preCondition first (along with the OP_QUERY parsing code it depends on) and then as a subsequent step get rid of atomic applyOps wholesale. If that makes sense to you, then I can pick up SERVER-33182 next sprint.

Comment by Louis Williams [ 18/Aug/22 ]

david.storch@mongodb.com I believe this duplicates SERVER-33182 to remove the atomic applyOps command. That is the only case where a preCondition is allowed.

Generated at Thu Feb 08 06:07:20 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.