Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CDRIVER-629 remove MONGOC_WRITE_CONCERN_W_ERRORS_IGNORED #1940

Merged
merged 2 commits into from
Mar 21, 2025

Conversation

kevinAlbs
Copy link
Collaborator

Summary

Remove the MONGOC_WRITE_CONCERN_W_ERRORS_IGNORED (-1) value, which is equivalent to MONGOC_WRITE_CONCERN_W_UNACKNOWLEDGED (0).

Notes

I was surprised to discover mongoc_write_concern_is_valid returns true for unsupported values of w. This PR does not change this behavior. The server returns an error for a negative w value:

$ mongosh --eval "db.runCommand({insert: 'c', documents: [{}], writeConcern: {w: -1}})"
MongoServerError: w has to be a non-negative number and not greater than 50; found: -1

Adding a client-side error might go against the Where possible, depend on server to return errors mantra.

@kevinAlbs kevinAlbs marked this pull request as ready for review March 20, 2025 12:45
@kevinAlbs kevinAlbs merged commit b266c16 into mongodb:master Mar 21, 2025
40 of 42 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.

2 participants