[CDRIVER-581] URI parsing should not assume write concern defaults Created: 13/Mar/15  Updated: 03/Apr/15  Resolved: 16/Mar/15

Status: Closed
Project: C Driver
Component/s: None
Affects Version/s: None
Fix Version/s: 1.1.4

Type: Bug Priority: Minor - P4
Reporter: Jeremy Mikola Assignee: Jeremy Mikola
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
depends on CDRIVER-580 Write concern with w=0 and j=true is ... Closed

 Description   

I noticed that (_mongoc_uri_build_write_concern() parses w=1 as MONGOC_WRITE_CONCERN_W_DEFAULT. Combined with CDRIVER-580, this means the driver could send an empty write concern to the server, which could result in an unexpected server-side default being applied.



 Comments   
Comment by Githook User [ 24/Mar/15 ]

Author:

{u'username': u'jmikola', u'name': u'Jeremy Mikola', u'email': u'jmikola@gmail.com'}

Message: CDRIVER-581: Don't assume write concern defaults in URI parsing

False safe/journal values should be explicitly set on the write concern. Additionally, w=1 should not be parsed as MONGOC_WRITE_CONCERN_W_DEFAULT, since the driver would then omit it from the write concern and allow a different server-side default to be applied.

Closes #195
Branch: 1.2.0-dev
https://github.com/mongodb/mongo-c-driver/commit/208355d7a49fa66ab100c353c14d1afe1276e432

Comment by Githook User [ 16/Mar/15 ]

Author:

{u'username': u'jmikola', u'name': u'Jeremy Mikola', u'email': u'jmikola@gmail.com'}

Message: CDRIVER-581: Don't assume write concern defaults in URI parsing

False safe/journal values should be explicitly set on the write concern. Additionally, w=1 should not be parsed as MONGOC_WRITE_CONCERN_W_DEFAULT, since the driver would then omit it from the write concern and allow a different server-side default to be applied.

Closes #195
Branch: master
https://github.com/mongodb/mongo-c-driver/commit/208355d7a49fa66ab100c353c14d1afe1276e432

Comment by Jeremy Mikola [ 13/Mar/15 ]

https://github.com/mongodb/mongo-c-driver/pull/195

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