[SERVER-73073] Refactor existing time-series deletes to use expression_algo::splitMatchExpressionBy() Created: 19/Jan/23 Updated: 29/Oct/23 Resolved: 25/Feb/23 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | 7.0.0-rc0 |
| Type: | Improvement | Priority: | Major - P3 |
| Reporter: | Charlie Swanson | Assignee: | Yoon Soo Kim |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||||||||||||||||||||||
| Assigned Teams: |
Storage Execution
|
||||||||||||||||||||||||||||
| Backwards Compatibility: | Fully Compatible | ||||||||||||||||||||||||||||
| Sprint: | Execution Team 2023-02-20 | ||||||||||||||||||||||||||||
| Participants: | |||||||||||||||||||||||||||||
| Linked BF Score: | 171 | ||||||||||||||||||||||||||||
| Description |
|
The existing delete path calls into 'timeseries::translateQuery()', which is an algorithm over the raw BSON object. We have well tested algorithms to do essentially the same thing - the 'renames' argument to expression_algo::splitMatchExpressionBy() will provide the same ability to detect, split, and rename the predicates on the meta field. It returns a pair of new MatchExpressions, one of which has the renames applied and should be only the meta expressions. The other one will have "the rest." For now, if "the rest" is not nullptr we can return an error - that's the current behavior. Caveat: the current helper function may or may not support the same expressions. It looks like it attempts to support some $jsonSchema operators which I don't think we bother to do in the 'splitMatchExpressionBy()' algorithm. The catch of course is that it operates on a MatchExpression*, which we don't have at the point we call 'timeseries::translateQuery()' today. This is conceptually quite easy - we can just parse the query earlier. In practice it turns out to be tricky though due to the way we used this 'DeleteRequest' and 'ParsedDelete' utilities, and how we cannot correctly parse a query until we've made an ExpressionContext - which should have the correct collator set - among other params. So this ticket tracks just the work for the delete path. There will be similar work focused on UpdateRequest and ParsedUpdate later in a subsequent ticket. |
| Comments |
| Comment by Githook User [ 25/Feb/23 ] |
|
Author: {'name': 'Yoonsoo Kim', 'email': 'yoonsoo.kim@mongodb.com', 'username': 'yun-soo'}Message: |
| Comment by Githook User [ 24/Feb/23 ] |
|
Author: {'name': 'liubov.molchanova', 'email': 'liubov.molchanova@mongodb.com', 'username': 'liubov-molchanova'}Message: Revert " This reverts commit 20947dce4e6bd0a07f83b7d32f858c1e060a914d. |
| Comment by Githook User [ 24/Feb/23 ] |
|
Author: {'name': 'Yoonsoo Kim', 'email': 'yoonsoo.kim@mongodb.com', 'username': 'yun-soo'}Message: |