-
-
Notifications
You must be signed in to change notification settings - Fork 506
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
WriteConcern option never passes into MongoDB #2292
Comments
Now that you mention it...updating the commit options to use |
@alcaeus passing |
The true way is to pass a write concern option: $dm->flush(['writeConcern' => new \MongoDB\Driver\WriteConcern('majority')]) |
Looks like this method should be removed or refactored because it works wrong and consfusing |
You've found the source of the problem. Want to create a PR to fix the issue? :) |
Yes I can if you describe the correct behavior in your opinion |
Instead of passing on the |
@alcaeus Please tell which base branch I should use to fix |
2.2.x is our current branch for bug fixing. Thanks! |
Fixed in #2294. |
Bug Report
Summary
I'm sorry in advance if I've just not figured out.
I want to be sure the transaction was processed on majority replicas, I've set up
w: majority
option indoctrine_mongodb.default_commit_options
, and try to debug where this option passed into MongoDB and did not find any cases.DocumentPersister::getWriteOptions
returns['w' => 'majority']
and then options passew toMongoDB\Collection::updateOne
which never useww
key, it expectswriteConcern
key with object instance ofMongoDB\Driver\WriteConcern
.Current behavior
WriteConcern option never passes into MongoDB.
How to reproduce
Just try to pass
w
as write options and check it's never used inmongodb/mongodb
.Expected behavior
WriteConcern correctly passes info
mongodb/mongodb
and exists in request.The text was updated successfully, but these errors were encountered: