[DRIVERS-2064] Add a uri options spec test for w=-2 Created: 30/Sep/19  Updated: 31/Mar/22

Status: Backlog
Project: Drivers
Component/s: Read and Write Concern, URI Options
Fix Version/s: None

Type: Spec Change Priority: Minor - P4
Reporter: Oleg Pudeyev (Inactive) Assignee: Unassigned
Resolution: Unresolved Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
Related
related to RUBY-1696 Add read/write concern spec runner & ... Closed
related to DRIVERS-2149 Read/write concern test's wtimeoutMS ... Backlog
Driver Changes: Needed

 Description   

There is currently a lack of clarity for how a driver is to handle the case of negative w values in uris.

The uri spec says that w is a "non-negative integer" or a string. However, there is no test in the uri options for a negative w.

Per https://jira.mongodb.org/browse/SPEC-1457, uri spec similarly says that wtimeoutms is a "non-negative integer" and there is a test for wtimeoutms being a negative number, which results in a valid uri with a warning. This test conflicts with a read/write concern test for a negative wtimeoutms which expects this to be an error.

For w, there is no uri option test but there is a read/write concern spec test requiring w=-2 to be an error. Going by this test, the handling of w is inconsistent with the handling of wtimeoutms.

For clarity it will be helpful if the uri options tests included a test case for a negative w, or if read/write concern spec tests for w were changed to require the result be a valid uri with a warning, or if the uri options spec added a rationale stating why w=-2 is an error but wtimeoutms=-2 is a valid uri with a warning.



 Comments   
Comment by Jeremy Mikola [ 01/Oct/19 ]

For context, I believe -2 was used because some drivers under the libmongoc umbrella accept -1 as a historical mode that ignores socket errors (i.e. MONGOC_WRITE_CONCERN_W_ERRORS_IGNORED).

Generated at Thu Feb 08 08:24:38 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.