-
Type: Improvement
-
Resolution: Fixed
-
Priority: Major - P3
-
Affects Version/s: None
-
Component/s: None
-
None
-
Storage Execution
-
Fully Compatible
-
Execution Team 2023-02-20
-
171
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.
- depends on
-
SERVER-73535 Add more support for $jsonSchema in 'expression_algo::splitMatchExpressionBy'
- Closed
-
SERVER-73074 Add splitMatchExpressionBy test cases for $jsonSchema.required expression
- Closed
-
SERVER-73914 Implement renames for kArrayMatching MatchExpressions
- Closed
- is depended on by
-
SERVER-73142 Add multi-update ability for TS_WRITE (limited)
- Closed
-
SERVER-73077 Add TS_WRITE stage which supports multi-deletes but cannot retry upon failure
- Closed