Skip to content

Conversation

@kevinAlbs
Copy link
Contributor

@kevinAlbs kevinAlbs commented Sep 2, 2025

Summary

Document expected server error codes in prose test for CSFLE/QE bulkWrite prose test expecting a "too-large document" error.

Motivation

SERVER-104405 recently changed the expected error code. This broke some drivers testing of BSON Size Limits and Batch Splitting. Document the expected server errors in the specification.

Checking server error codes is not made into a requirement. MongoCollection.bulkWrite does not prohibit client-side checks after auto-encryption. The expected error might be a driver-side or server-side error.


Please complete the following before merging:

@kevinAlbs kevinAlbs requested a review from NoahStapp September 2, 2025 19:36
@kevinAlbs kevinAlbs marked this pull request as ready for review September 2, 2025 19:38
@kevinAlbs kevinAlbs requested a review from a team as a code owner September 2, 2025 19:38
@kevinAlbs kevinAlbs requested review from katcharov and removed request for a team September 2, 2025 19:38

Expect this to fail since encryption results in a document exceeding the `maxBsonObjectSize` limit.
Expect this to fail indicating the document exceeded the `maxBsonObjectSize` limit. If the write is sent to the
server, expect a server error with code 2 or 10334.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we want to explicitly require drivers check the error code here? Or only if they do check the error code, to expect these codes?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The latter. I expect MongoCollection.bulkWrite does not prohibit client-side size checks after auto-encryption. This is only intended to check the server error code if the write is sent to the server.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does sending the write to the server then imply that the driver also checks the error code?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I expect if the driver sends the write to the server (i.e. does not fail earlier with a driver-side check) that a driver should check the expected error code to ensure they get the expected error. Updated text to clarify.

@kevinAlbs kevinAlbs requested review from NoahStapp and removed request for katcharov September 2, 2025 20:27
@kevinAlbs kevinAlbs merged commit 3aa0528 into mongodb:master Sep 3, 2025
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants