[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: |
|
||||||||
| Assigned Teams: |
Sharding NYC
|
||||||||
| Sprint: | Sharding NYC 2023-09-18 | ||||||||
| Participants: | |||||||||
| Story Points: | 2 | ||||||||
| Description |
|
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 |