[SERVER-78385] Update findAndModify and deleteOne to not use two phase protocol if only one shard is targeted Created: 23/Jun/23  Updated: 15/Sep/23  Resolved: 15/Sep/23

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

Type: Task Priority: Major - P3
Reporter: Wenqin Ye Assignee: Wenqin Ye
Resolution: Won't Do Votes: 0
Labels: sharding-nyc-subteam3
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
depends on SERVER-44422 Allow findAndModify and delete one to... Closed
Assigned Teams:
Sharding NYC
Sprint: Sharding NYC 2023-09-18
Participants:
Story Points: 2

 Description   

SERVER-44422 made it so that findAndModify and delete (with limit=1) still work if the two phase protocol is disabled and only the partial shard key is given, as long as only one shard is targeted.

However, those changes have no effect on master because the two phase protocol will always be used if a partial shard key is given. This ticket should update the code for findAndModify and delete (with limit=1) to not use the two phase protocol if a partial shard key is given and only one shard is targeted.



 Comments   
Comment by Wenqin Ye [ 15/Sep/23 ]

Closing as this is actually not needed. The premise of the ticket was wrong, as the two phase write protocol will be skipped if a partial shard key is given and it targets a single shard. 

More specifically for findAndModify that happens here: https://github.com/10gen/mongo/blob/c3cd9fcd6e2da113e8bf299abf893ac28d92859c/src/mongo/s/commands/cluster_find_and_modify_cmd.cpp#L758-L759

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