Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

CDRIVER-5945 mongoc_collection_create_indexes_with_opts does not apply write command behavior #2099

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

Merged

Conversation

Copy link
Contributor

@Julia-Garland Julia-Garland commented Aug 27, 2025
edited
Loading

Summary

mongoc_collection_create_indexes_with_opts uses mongoc_client_command_with_opts rather than mongoc_collection_write_command_with_opts. As a result, write command behavior is not applied:

  • Write concern is not inherited from the parent mongoc_collection_t (contrary to documentation)
  • A server reply with a "writeConcernError" does not result in a failing return.

These changes now call mongoc_collection_write_command_with_opts.

A test was added to reproduce the errors in the original code and confirm that write command behavior is fixed with the correct call.

@Julia-Garland Julia-Garland changed the title (削除) Use mongoc_collection_write_command_with_opts (削除ここまで) (追記) CDRIVER-5945 mongoc_collection_create_indexes_with_opts does not apply write command behavior (追記ここまで) Aug 27, 2025
@Julia-Garland Julia-Garland marked this pull request as ready for review August 28, 2025 13:41
@Julia-Garland Julia-Garland requested a review from a team as a code owner August 28, 2025 13:41
@Julia-Garland Julia-Garland requested review from mdb-ad and vector-of-bool and removed request for mdb-ad August 28, 2025 13:41
Copy link
Contributor

@vector-of-bool vector-of-bool left a comment

Choose a reason for hiding this comment

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

LGTM!

@Julia-Garland Julia-Garland merged commit 798dd7d into mongodb:master Aug 29, 2025
44 of 46 checks passed
@Julia-Garland Julia-Garland deleted the write-command-behavior.cdriver-5945 branch August 29, 2025 18:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Reviewers

@vector-of-bool vector-of-bool vector-of-bool approved these changes

Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

AltStyle によって変換されたページ (->オリジナル) /