[SERVER-77648] Support sending OpMsgRequests via AsyncRequestSender and switch to using it for batched writes Created: 31/May/23  Updated: 03/Jul/23  Resolved: 03/Jul/23

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

Type: Improvement Priority: Major - P3
Reporter: Kaitlin Mahar Assignee: Backlog - Service Architecture
Resolution: Duplicate Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Duplicate
Related
Assigned Teams:
Service Arch
Participants:

 Description   

Currently, AsyncRequestsSender requests may only be created using a BSONObj version of a command to run.

This means that any command run via this (which includes all write commands sent mongod -> mongos) must be serialized via its IDL-generated serialize implementation that serializes to a BsonObjBuilder. Notably, this means that any array in a command will be serialized as a BSON array, even if the command argument supports OP_MSG document sequences, which are more space-efficient.

We should add support to AsyncRequestsSender to allow running an OpMsgRequest rather than just a BSONObj. Then we could switch to serializing commands using their IDL-generated serialize implementations that produce OpMsgRequests and utilize the more efficient encoding. This would allow us to more efficiently send batched writes to shards.

We would also want to update our write op size estimation logic if we do this, since currently we account for the per-array-element overhead for each op.



 Comments   
Comment by Phoebe Du [ 03/Jul/23 ]

Turning this Server ticket into a Project: https://jira.mongodb.org/browse/PM-3403

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