[SERVER-64357] Server-side rewrite for findAndModify command on mongos Created: 09/Mar/22  Updated: 29/Oct/23  Resolved: 07/Apr/22

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

Type: Task Priority: Major - P3
Reporter: Davis Haupt (Inactive) Assignee: Nicholas Zolnierz
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
Duplicate
is duplicated by SERVER-63300 Server-side rewrite for findAndModify... Closed
Backwards Compatibility: Fully Compatible
Sprint: QO 2022-03-21, QO 2022-04-04, QO 2022-04-18
Participants:
Linked BF Score: 163

 Description   

From the design:

findAndModify commands are minimally rewritten before being more-or-less "blindly" passed on to the relevant shard, since the query must have an equality condition on the shard key in order to precisely target a single shard. We will have to do some more processing than for the find() command because the command BSON is not fully parsed. If there may be FLE2 rewrites to be done and we are inside of a transaction, we will add this procedure after the first rewrite:

  1. Inspect the command BSON to determine if there may be rewrites to be done
  2. Parse the "query" sub-object into a MatchExpression
  3. Rewrite the parsed query using rewriteQueryOnEncryptedFields()
  4. Serialized rewritten MatchExpression to BSON
  5. Replace "query" sub-object of command with the rewritten MatchExpression.


 Comments   
Comment by Githook User [ 06/Apr/22 ]

Author:

{'name': 'Nicholas Zolnierz', 'email': 'nicholas.zolnierz@mongodb.com', 'username': 'nzolnierzmdb'}

Message: SERVER-64357 Update fle2 suite to have 2 data bearing nodes to allow majority writeConcern
Branch: master
https://github.com/mongodb/mongo/commit/87c3421e0028b33d5826abf62348d230487328cc

Comment by Nicholas Zolnierz [ 06/Apr/22 ]

Reopening since one of the tests is failing in the fle2 suite

Comment by Githook User [ 05/Apr/22 ]

Author:

{'name': 'Nicholas Zolnierz', 'email': 'nicholas.zolnierz@mongodb.com', 'username': 'nzolnierzmdb'}

Message: SERVER-64357 Rewrite filter over encrypted fields for findAndModify command
Branch: master
https://github.com/mongodb/mongo/commit/4a594750742b3620dba3696cb6e91d60aa8d0df6

Comment by Githook User [ 05/Apr/22 ]

Author:

{'name': 'Nicholas Zolnierz', 'email': 'nicholas.zolnierz@mongodb.com', 'username': 'nzolnierzmdb'}

Message: SERVER-64357 Integration testing for findAndModify filter rewrite
Branch: master
https://github.com/10gen/mongo-enterprise-modules/commit/d4f7fdd6e1721b40ebf5be6f5d849e44a400ed55

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