Operational Defect Database

BugZero found this defect 18 days ago.

MongoDB | 2659289

BulkWrite mongos child batches can break BSON size limit

Last update date:

5/1/2024

Affected products:

MongoDB Server

Affected releases:

No affected releases provided.

Fixed releases:

No fixed releases provided.

Description:

Info

In bulkWrite we always append the entire nsInfo array to child batches we send from mongos -> mongod. nsInfo supports document sequences but we cannot send document sequences in mongos to mongod communication (see SERVER-77648). This means that any initial bulkWrite sent to mongos that required doc sequencing for the nsInfo will never be able to proceed and send child batches to mongod. To fix this we would need to create a new nsInfo array to attach to child batches, this would also require updating the original ops to point to the new index. This is not a difficult fix but needs to be done and tested carefully to make sure we do not break existing correctness. It should be pretty rare for users to hit this since it would require writes being done to a lot of very long named namespaces in the same bulkWrite. Even for users who don't see a command failure due to this there can still be some perf improvements by doing this fix, if we have 14MB of just nsInfo then that only leaves 2MB of writes in every child batch which can cause us to send more batches than is optimal, so this fix does not only impact users who need document sequencing for nsInfo.

Top User Comments


Steps to Reproduce


Additional Resources / Links

Share:

BugZero® Risk Score

What's this?

Coming soon

Status

Needs Scheduling

Learn More

Search:

...