[SERVER-83451] Remove unnecessary calls to stdx::visit in bulk write Created: 20/Nov/23  Updated: 31/Jan/24  Resolved: 31/Jan/24

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

Type: Task Priority: Major - P3
Reporter: Vishnu Kaushik Assignee: Sean Zimmerman
Resolution: Fixed Votes: 0
Labels: milestone-1
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
is related to SERVER-83148 Investigate hand parsing bulkWrite co... Closed
Assigned Teams:
Replication
Backwards Compatibility: Fully Compatible
Sprint: Repl 2024-01-08, Repl 2024-02-05
Participants:

 Description   

Sometimes, from metadata we have information already on what type of operation (insert / update / delete) an op is. In these cases, if it is possible to make a decision already, there is no need to call stdx::visit.

For example, in this code we use stdx::visit and accordingly return an action type of ActionType::insert, etc.

But since we already have the _type saved on construction, we can just use that to determine which action type to return.

We should also investigate if saving any metadata about the operation (such as its nsInfo index) at the time of parsing would help us avoid these calls as well, since currently each time we want to fetch the nsInfo index we incur a stdx::visit call.



 Comments   
Comment by Githook User [ 31/Jan/24 ]

Author:

{'name': 'seanzimm', 'email': '102551488+seanzimm@users.noreply.github.com', 'username': 'seanzimm'}

Message: SERVER-83451: Remove unnecessary std::visit call from bulkWrite (#18552)

GitOrigin-RevId: 5010131f446e1974d097c39f7d2b0b431251c81f
Branch: master
https://github.com/mongodb/mongo/commit/3c017a0e206dff788d3d4a2f11618310cb97b78f

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