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

mgo still not support writeConcern for findAndModify #176

Closed
Mei-Zhao opened this issue May 25, 2018 · 1 comment
Closed

mgo still not support writeConcern for findAndModify #176

Mei-Zhao opened this issue May 25, 2018 · 1 comment

Comments

@Mei-Zhao
Copy link

Mei-Zhao commented May 25, 2018

mongod has support writeConcern for findAndModify command since v3.2

https://docs.mongodb.com/v3.4/reference/command/findAndModify/#dbcmd.findAndModify(the Output part still not update)

If the cluster has been set with getLastErrorDefaults like:

` "getLastErrorDefaults" :
{

  "w" : "majority",

  "wtimeout" : 5000

} `

The cluster has 5 nodes and 3 of them have been locked by fsyncLock().
The test result returned from Mongod (v3.4) about a findAndModify command like

findAndModify: { "lastErrorObject" : { "n" : 1, "updatedExisting" : true }, "ok" : 1, "writeConcernError" : { "code" : 64, "errInfo" : { "wtimeout" : true }, "errmsg" : "waiting for replication timed out", "codeName" : "WriteConcernFailed" }, "value" : { "fid" : 367585860, "_id" : "5afbf542588399814fe36b5a" } }

The findAndModify result define in mgo seesion.go did not deal with writeConcernErr,in detail:

` type valueResult struct {

Value     bson.Raw

LastError LastError `bson:"lastErrorObject"`

}`

@domodwyer
Copy link

Hi @Mei-Zhao

This mgo fork is a community project - we'll happily accept a PR for findAndModify!

Dom

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

No branches or pull requests

2 participants