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

Validate that there are <= maxWriteBatchSize ops in bulkWrite command

    • Type: Icon: Task Task
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 7.1.0-rc0
    • Affects Version/s: None
    • Component/s: None
    • Replication
    • Fully Compatible
    • Repl 2023-05-29

      For other write commands, e.g. insert, we validate on mongod that there are <= maxWriteBatchSize ops in an incoming command, using checkOpCountForCommand (here). For example, InsertOp::validate (here) calls this.

      However, we don't appear to enforce this limit for bulkWrite right now.

      As far as I can tell, we don't enforce the limit for incoming commands on mongos, though we do ensure that outgoing commands on mongos respect the limit. So we likely only need to make a change on mongod, though it might be worth confirming this with the sharding team to make sure we didn't miss any logic around this. Update: Testing and further investigation revealed that the limits are in fact enforced on mongos. E.g. for insert, ClusterInsertCmdBase::parse calls BatchedCommandRequest::parseInsert which ends up calling down through to InsertOp::parse which calls validate and checks the op count.

            Assignee:
            sean.zimmerman@mongodb.com Sean Zimmerman
            Reporter:
            kaitlin.mahar@mongodb.com Kaitlin Mahar
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: