[SERVER-12307] Provide a means in query framework to efficiently determine if a query is $isolated Created: 09/Jan/14  Updated: 16/Mar/16  Resolved: 11/Mar/16

Status: Closed
Project: Core Server
Component/s: Querying
Affects Version/s: None
Fix Version/s: 3.3.3

Type: Improvement Priority: Minor - P4
Reporter: Andrew Morrow (Inactive) Assignee: Benjamin Murphy
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
is depended on by SERVER-22833 MatchExpression::toBSON does not nece... Closed
Related
related to SERVER-17846 Non-update/non-delete user operations... Closed
Backwards Compatibility: Fully Compatible
Sprint: Quint Iteration 7, Query 11 (03/14/16)
Participants:

 Description   

Right now, $isolated is handled as an expression tree node. When update wants to find out if the current op is $isolated, it needs to walk the children of the expression root.

It would probably be better if something like CanonicalQuery obtained this information during the initial parse and cached it.

The $isolated node probably doesn't need to stay in the tree.



 Comments   
Comment by Githook User [ 11/Mar/16 ]

Author:

{u'username': u'benjaminmurphy', u'name': u'Benjamin Murphy', u'email': u'benjamin_murphy@me.com'}

Message: SERVER-12307 Fix lint error.
Branch: master
https://github.com/mongodb/mongo/commit/1eedf75bf5ac0098f212d931bad94bd8b54060c3

Comment by Githook User [ 11/Mar/16 ]

Author:

{u'username': u'benjaminmurphy', u'name': u'Benjamin Murphy', u'email': u'benjamin_murphy@me.com'}

Message: SERVER-12307 CanonicalQuery tracks whether an update or delete is isolated.
Branch: master
https://github.com/mongodb/mongo/commit/0acec64c6eb36c80aab0984068ef5ac0fef23f21

Comment by J Rassi [ 01/Apr/15 ]

The breakdown of work for this ticket is as follows:

  • CanonicalQuery should get a new private member _isIsolated (initialized in CanonicalQuery::init()) and a corresponding public getter.
  • The AtomicMatchExpression class should be deleted, though the expression parser should continue to enforce the existing predicate grammar ($atomic/$isolated only allowed at top level). Users of MatchExpression::ATOMIC should be converted to use the CanonicalQuery public getter instead.
  • AtomicMatchExpressionTest::Simple1 should be renamed to MatchExpressionParserTest::AtomicOperator1. Negative tests should be added to ensure that expressions fail the parsing step if $atomic/$isolated are not at the top level.
  • Unit tests should be added for LiteParsedQuery::isQueryIsolated().
  • Unit tests should be added for the new CanonicalQuery public getter.

As part of future work, we should make sure that non-update/non-delete user operations fail if a user attempts to use the $atmoic/$isolated operators as part of a query predicate. Filed SERVER-17846 to track this.

Generated at Thu Feb 08 03:28:11 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.