[CDRIVER-2995] Failing aggregate-out unit test with write concern Created: 06/Mar/19  Updated: 28/Oct/23  Resolved: 07/Mar/19

Status: Closed
Project: C Driver
Component/s: libmongoc
Affects Version/s: 1.14.0
Fix Version/s: 1.15.0

Type: Bug Priority: Major - P3
Reporter: Amy Giersch Assignee: Unassigned
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

AIX/gcc


Issue Links:
Related
is related to CDRIVER-2939 Drivers should ignore batchSize=0 for... Closed

 Description   

Unit test /crud/read/aggregate-out fails when a write concern is in the connection string for the 2nd test with batchSize = 0.  Since batchSize = 0 get back a cursor after the aggregate command, a getMore is sent and getMore contains the write concern.

Looks like this will be fixed by the changes for CDRIVER-2939 as that will no longer send batchSize = 0.  

"results": [
Expected success, got error "Command does not support writeConcern":
{ "name" : "aggregate", "arguments" : { "pipeline" : [ { "$sort" :

{ "x" : 1 }

}, { "$match" : { "_id" :

{ "$gt" : 1 }

} }, { "$out" : "other_test_collection" } ], "batchSize" : 0 } }
{ "status": "fail", "test_file": "/crud/read/aggregate-out", "seed": "1278059495", "start": 4126.506109, "end": 4127.022308, "elapsed": 0.516199 }
]

Command getMore started:

{ "getMore" : 5371882048943694072, "collection" : "test", "writeConcern" : \{ "w" : "majority", "j" : true }

, "$db" : "test", "lsid" : { "id" : { "$binary" :

{ "base64": "sAS3DPNiTS6ApKYrrupusQ==", "subType" : "04" }

} }, "$clusterTime" : { "clusterTime" : { "$timestamp" :

{ "t" : 1551826988, "i" : 16 }

}, "signature" : { "hash" : { "$binary" :

{ "base64": "AAAAAAAAAAAAAAAAAAAAAAAAAAA=", "subType" : "00" }

}, "keyId" : 0 } }
}



 Comments   
Comment by Kevin Albertson [ 07/Mar/19 ]

Hi Amy, thanks for the detailed report! As you predicted, this is resolved in CDRIVER-2939 and will be fixed in the 1.15.0 release.

To double check, I reproduced your test failure locally by running test-libmongoc with MONGOC_TEST_URI of mongodb://localhost:27017/db?w=1 before the changes of CDRIVER-2939, and confirmed that CDRIVER-2939 does fix it.

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