[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: |
|
||||||||||||||||||||
| 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: |
| 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 |
| Comment by Louis Williams [ 18/Aug/22 ] |
|
david.storch@mongodb.com I believe this duplicates |