[CDRIVER-3268] Inherited unacknowledged write concern errors in transaction Created: 05/Aug/19  Updated: 28/Oct/23  Resolved: 09/Aug/19

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

Type: Bug Priority: Major - P3
Reporter: Kevin Albertson Assignee: Kevin Albertson
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   

The /transactions/write-concern test is failing in master after a bug with parsing the runOn constraint of the spec tests was fixed in CDRIVER-3266.

The failing test was using an unacknowledged write concern as a collection option, and expecting operations within the transaction to not apply that write concern and succeed:

[2019/08/02 14:22:31.344] Expected success, got error "Cannot use client session with unacknowledged writes":
[2019/08/02 14:22:31.344] { "name" : "insertOne", "object" : "collection", "collectionOptions" : { "writeConcern" : { "w" : 0 } }, "arguments" : { "session" : "session0", "document" : { "_id" : 1 } }, "result" : { "insertedId" : 1 } }

Though the transaction's spec states:

Drivers MUST NOT add the transaction’s writeConcern or any writeConcern inherited from the collection, database, or client to any preceding commands in the transaction.



 Comments   
Comment by Githook User [ 06/Aug/19 ]

Author:

{'name': 'Kevin Albertson', 'username': 'kevinAlbs', 'email': 'kevin.albertson@10gen.com'}

Message: CDRIVER-3268 do not inherit collection write concern if in txn
Branch: master
https://github.com/mongodb/mongo-c-driver/commit/9a6acb4fad99e94acb69ed9ab6669e48d11e5202

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