[SERVER-77010] Improve error message when DocumentSourceWriter cannot make progress due to an oversized write batch Created: 10/May/23  Updated: 23/May/23

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

Type: Improvement Priority: Major - P3
Reporter: Mihai Andrei Assignee: Backlog - Query Execution
Resolution: Unresolved Votes: 0
Labels: neweng
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Assigned Teams:
Query Execution
Participants:

 Description   

When $merge or $out has to issue a remote write and needs to serialize a write batch to BSON, it can fail with a BSONObjectTooLarge error. In the past, this was because we were incorrectly computing the size of each insert/update statement (see SERVER-66289 and SERVER-74806 for more details). Nowadays, this can still occur if the size of a single write plus the size of the impersonation metadata and the write header size (that is, the fields outside of the individual write statements themselves) exceeds the BSONObj size limit. Though this is correct behavior, it isn't helpful for a user to see a BSONObjectTooLarge error as it doesn't give them any clue as to what could be going wrong. This ticket tracks the work to emit a more descriptive error message when DocumentSourceWriter fails in this way.


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