[CDRIVER-901] _mongoc_write_result_complete() does not populate bson_error_t from write concern errors Created: 01/Oct/15  Updated: 19/Oct/16  Resolved: 06/Oct/15

Status: Closed
Project: C Driver
Component/s: libmongoc
Affects Version/s: 1.2-rc0
Fix Version/s: 1.2.0

Type: Bug Priority: Major - P3
Reporter: Jeremy Mikola Assignee: A. Jesse Jiryu Davis
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
is depended on by PHPC-434 WriteResult should merge multiple wri... Closed
Related
related to CDRIVER-710 Wrong writeConcernErrors format Closed

 Description   

With CDRIVER-710, mongoc_write_result_t now stores an array of writeConcernErrors. As I was updating PHPC for this API change, I traced how write concern errors are reported, since we need to turn those bson_error_t output variables into exceptions.

I traced the logic from mongoc_bulk_operation_execute() through to _mongoc_write_result_complete() and it appears that the bson_error_t is only ever set from write errors; however, the function may still return false for either !result->failed or bson_empty0 (&result->writeConcernErrors) (which is equivalent to checking for a non-zero result.n_writeConcernErrors value).

I can't speak for the !result->failed case, but I believe we want to integrate mongos' write concern error merging logic here, which I would otherwise need to do in PHPC-434 and HHVM-112.



 Comments   
Comment by Githook User [ 06/Oct/15 ]

Author:

{u'username': u'ajdavis', u'name': u'A. Jesse Jiryu Davis', u'email': u'jesse@mongodb.com'}

Message: CDRIVER-901 document bulk write error domains
Branch: 1.2.0-dev
https://github.com/mongodb/mongo-c-driver/commit/f880d1911e0976e05b232cca777a8920e7d7e237

Comment by Githook User [ 06/Oct/15 ]

Author:

{u'username': u'ajdavis', u'name': u'A. Jesse Jiryu Davis', u'email': u'jesse@mongodb.com'}

Message: CDRIVER-901 update bson_error_t from write concern err
Branch: 1.2.0-dev
https://github.com/mongodb/mongo-c-driver/commit/5ea44ed8c59eaf20120e173144f8691d86ce5c3d

Generated at Wed Feb 07 21:10:57 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.