[CXX-1893] Test 3.6 drivers against 4.2 servers Created: 17/Dec/19  Updated: 30/Jul/20  Resolved: 30/Jul/20

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

Type: Task Priority: Major - P3
Reporter: PM Bot Assignee: Kevin Albertson
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Attachments: Text File 1.10.3-test_crud_specs.log     Text File 1.10.3-test_driver.log    
Issue Links:
Depends
is depended on by DRIVERS-788 Test 3.6 drivers against 4.2 servers Closed

 Description   

See DRIVERS-788 for details.



 Comments   
Comment by Kevin Albertson [ 30/Jul/20 ]

The first version of the C++ driver to fully support 3.6 is 3.3.0. I tested against the latest patch release: 3.3.2.

http://mongocxx.org documents 1.10.1 as the minimum required version of libmongoc. I installed the latest patch release: 1.10.3.

I built tests using version 3.3.2, the first version of the C++ driver to fully support 3.6 servers.

I observed several test failures running against libmongoc 1.10.3. The failures appear to be caused by sending an empty write concern document with find_and_modify functions. Example:

-------------------------------------------------------------------------------
lsid
collection::find_one_and_delete
-------------------------------------------------------------------------------
../src/mongocxx/test/client_session.cpp:530
...............................................................................
 
../src/mongocxx/test/client_session.cpp:530: FAILED:
due to unexpected exception with message:
write concern object cannot be empty: generic server error
 
-------------------------------------------------------------------------------

All test failures are attached as 1.10.3-test_driver.log.

These tests pass in latest libmongoc (1.11.0). I believe this is due to how write concern handling was changed in mongoc_collection_find_and_modify in this commit:
https://github.com/mongodb/mongo-c-driver/commit/806cddb2acde03f5462460491f38fa21332b7d97#diff-761ee8f8a41e2a37c0ca00d776863e20L2999

This changed how a writeConcern inherited from the collection was appended. After the change, write concern was set via mongoc_cmd_parts_set_write_concern instead of appending directly to the command. This bypasses appending to the final command if the write concern document is empty here.

A similar failure occurred in test_crud_specs, and was also resolved with upgrading to 1.11.0.

Generated at Wed Feb 07 22:04:15 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.