Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-77648

Support sending OpMsgRequests via AsyncRequestSender and switch to using it for batched writes

    • Type: Icon: Improvement Improvement
    • Resolution: Duplicate
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None
    • None
    • Service Arch

      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.

            Assignee:
            backlog-server-servicearch [DO NOT USE] Backlog - Service Architecture
            Reporter:
            kaitlin.mahar@mongodb.com Kaitlin Mahar
            Votes:
            0 Vote for this issue
            Watchers:
            7 Start watching this issue

              Created:
              Updated:
              Resolved: