[CDRIVER-2558] Implement Transactions spec Created: 19/Mar/18  Updated: 28/Oct/23  Resolved: 22/Jun/18

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

Type: New Feature Priority: Major - P3
Reporter: Rathi Gnanasekaran Assignee: A. Jesse Jiryu Davis
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
is depended on by DRIVERS-417 Implement Transactions spec Closed
is depended on by PHPC-1140 Implement Transactions spec Closed
is depended on by DRIVERS-500 Resync transactions spec tests Closed
Problem/Incident
causes CDRIVER-2720 UnknownCommitResult, not TransientTra... Closed
Related
related to PHPC-1222 Implement accessor for error labels o... Closed
related to CDRIVER-2729 Add mongoc_client_session_in_transact... Closed
related to PHPC-1231 Add Session::isInTransaction to indic... Closed
Epic Link: CDRIVER MongoDB 4.0 Support

 Description   
  • Done: API and reference docs
  • Done: Remove autoStartTransaction
  • Done: Spec tests
  • Done: Test errors when connected to mongos or 3.6 replica set
  • Done: Create reply with errorLabels if commitTransaction gets no reply, check this is tested in JSON
  • Done: Add a function named like mongoc_error_has_label and replace the "transient" function in example-transaction.c
  • Done: Example code (besides CDRIVER-2663)
  • Done: Update "with_opts" functions' docs to say that a session's read concern, write concern, and read preference override the client/db/collection's setting if the session is in a transaction
  • Done: Prevent users from setting read concern, write concern, and read preference in a transaction using "opts"
  • Done: Same as above, specifically for mongoc_collection_count_documents
  • Done: Re-sync spec tests (they're changing a lot, SPEC-1084)
  • Done: Test that TransientTransactionError is added to server selection errors in transactions
  • Test that UnknownCommitResult is added to server selection errors during commitTransaction - spun off to CDRIVER-2720


 Comments   
Comment by Githook User [ 03/Aug/18 ]

Author:

{'name': 'Evgeni Dobranov', 'email': 'evobranov@gmail.com', 'username': 'edobranov'}

Message: CDRIVER-2558 fix transaction example
Branch: master
https://github.com/mongodb/mongo-c-driver/commit/1336e4cf2ee9e19aa64c89c8f4ac935143065174

Comment by Githook User [ 25/Jun/18 ]

Author:

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

Message: CDRIVER-2558 destroy request in test
Branch: master
https://github.com/mongodb/mongo-c-driver/commit/b4ddbfe0a4a0aa4ce06e7f517409c7e0977d2721

Comment by Githook User [ 22/Jun/18 ]

Author:

{'username': 'ajdavis', 'name': 'A. Jesse Jiryu Davis', 'email': 'jesse@mongodb.com'}

Message: CDRIVER-2558 leaks handling network errs
Branch: master
https://github.com/mongodb/mongo-c-driver/commit/9b6bf5871f8042a3f3d2c22fd03c98e84d1f5725

Comment by Githook User [ 22/Jun/18 ]

Author:

{'username': 'ajdavis', 'name': 'A. Jesse Jiryu Davis', 'email': 'jesse@mongodb.com'}

Message: CDRIVER-2558 more tests of network errs in txns
Branch: master
https://github.com/mongodb/mongo-c-driver/commit/57b349739faf284e553244ebcdfba77983b87462

Comment by Githook User [ 22/Jun/18 ]

Author:

{'username': 'ajdavis', 'name': 'A. Jesse Jiryu Davis', 'email': 'jesse@mongodb.com'}

Message: CDRIVER-2558 add label to server selection error
Branch: master
https://github.com/mongodb/mongo-c-driver/commit/53d3ec4020a34a3187c9cdec270e603069146650

Comment by Githook User [ 21/Jun/18 ]

Author:

{'username': 'ajdavis', 'name': 'A. Jesse Jiryu Davis', 'email': 'jesse@mongodb.com'}

Message: CDRIVER-2558 add "snapshot" readConcern
Branch: master
https://github.com/mongodb/mongo-c-driver/commit/c957a999eade9db290821ed31e822d7688830e17

Comment by Githook User [ 21/Jun/18 ]

Author:

{'username': 'ajdavis', 'name': 'A. Jesse Jiryu Davis', 'email': 'jesse@mongodb.com'}

Message: CDRIVER-2558 latest mongos has begun txn support
Branch: master
https://github.com/mongodb/mongo-c-driver/commit/1a86de5c1aff643d24bbd0f2df953583965e8dfe

Comment by Githook User [ 20/Jun/18 ]

Author:

{'username': 'ajdavis', 'name': 'A. Jesse Jiryu Davis', 'email': 'jesse@mongodb.com'}

Message: Merge remote-tracking branch 'upstream/master'

Comment by Githook User [ 20/Jun/18 ]

Author:

{'username': 'ajdavis', 'name': 'A. Jesse Jiryu Davis', 'email': 'jesse@mongodb.com'}

Message: CDRIVER-2558 insert test data with w=majority
Branch: master
https://github.com/mongodb/mongo-c-driver/commit/860dbf4f84bb40fe1067935abceacebb19c12a5c

Comment by Githook User [ 20/Jun/18 ]

Author:

{'username': 'ajdavis', 'name': 'A. Jesse Jiryu Davis', 'email': 'jesse@mongodb.com'}

Message: CDRIVER-2558 add mongoc_error_has_labels
Branch: master
https://github.com/mongodb/mongo-c-driver/commit/29feedc6008aeeac86593905c42fbbe416d5a20a

Comment by Githook User [ 20/Jun/18 ]

Author:

{'username': 'ajdavis', 'name': 'A. Jesse Jiryu Davis', 'email': 'jesse@mongodb.com'}

Message: CDRIVER-2558 prohibit per-operation options in txn

Users cannot pass read concern, write concern, or read preference to
"with_opts" functions in a transaction. To prevent this, keep the user's
read preference separate from the inherited read preference until it can
be checked in _mongoc_client_command_with_opts().

Most drivers don't allow these 3 options to be set per-operation, so the Transactions Spec doesn't test that setting them is prohibited in a
transaction. The new test file opts.yml uses the Transaction Spec's test
format for C Driver-specific tests of this scenario.

Also implement CDRIVER-2704, included upsertedCount in replies from mongoc_collection_update_one, update_many, and replace_one: it's useful
and allows us to use standard CRUD test specifications. Update our test
runner to use CRUD functions like mongoc_collection_insert_one instead
of using mongoc_bulk_operation_t for all writes.
Branch: master
https://github.com/mongodb/mongo-c-driver/commit/84d7dda4232f102fec5b090b7a863df6139fa480

Comment by Githook User [ 16/Jun/18 ]

Author:

{'username': 'ajdavis', 'name': 'A. Jesse Jiryu Davis', 'email': 'jesse@mongodb.com'}

Message: CDRIVER-2558 valgrind failure in txn test
Branch: master
https://github.com/mongodb/mongo-c-driver/commit/cb4aa084bcc701b8a8a5c8c051cc914433875ce9

Comment by A. Jesse Jiryu Davis [ 15/Jun/18 ]

Two commits where I put the wrong ticket number:

Message: avoid server lock timeout in test

See SERVER-35613, dropping and creating the collection right before
trying an insert in a transaction causes an error.

Branch: master
https://github.com/mongodb/mongo-c-driver/commit/ee2c423871cec96e587e758ffcbbda188fc49bdd

Message: avoid server lock timeout in test, 2

Write concern majority is a cleaner solution.
Branch: master
https://github.com/mongodb/mongo-c-driver/commit/800258f687af3e21c4905c9545615d3d51180a02

Comment by A. Jesse Jiryu Davis [ 15/Jun/18 ]

Two commits where I put the wrong ticket number:

Message: avoid server lock timeout in test

See SERVER-35613, dropping and creating the collection right before
trying an insert in a transaction causes an error.

Branch: master
https://github.com/mongodb/mongo-c-driver/commit/ee2c423871cec96e587e758ffcbbda188fc49bdd

Message: avoid server lock timeout in test, 2

Write concern majority is a cleaner solution.
Branch: master
https://github.com/mongodb/mongo-c-driver/commit/800258f687af3e21c4905c9545615d3d51180a02

Comment by Githook User [ 15/Jun/18 ]

Author:

{'username': 'ajdavis', 'name': 'A. Jesse Jiryu Davis', 'email': 'jesse@mongodb.com'}

Message: CDRIVER-2558 handle NULL reply out-pointer
Branch: master
https://github.com/mongodb/mongo-c-driver/commit/4a28aa81b49fb47aaa9f13b13bd54747b57bd7b1

Comment by Githook User [ 15/Jun/18 ]

Author:

{'username': 'ajdavis', 'name': 'A. Jesse Jiryu Davis', 'email': 'jesse@mongodb.com'}

Message: CDRIVER-2558 update transaction tests
Branch: master
https://github.com/mongodb/mongo-c-driver/commit/9684fb6c0383722865b4b04e59128b45ad17fddf

Comment by Githook User [ 12/Jun/18 ]

Author:

{'username': 'ajdavis', 'name': 'A. Jesse Jiryu Davis', 'email': 'jesse@mongodb.com'}

Message: CDRIVER-2558 add errorLabels to transaction errors
Branch: master
https://github.com/mongodb/mongo-c-driver/commit/5b1caf2b4aa1f6eb566807bd6f3315192248d1cf

Comment by Githook User [ 07/Jun/18 ]

Author:

{'username': 'ajdavis', 'name': 'A. Jesse Jiryu Davis', 'email': 'jesse@mongodb.com'}

Message: CDRIVER-2558 leak in txn w/ non-primary read pref
Branch: master
https://github.com/mongodb/mongo-c-driver/commit/6dfe26b369e4fcb46797742eca855372a6978b68

Comment by Githook User [ 06/Jun/18 ]

Author:

{'username': 'ajdavis', 'name': 'A. Jesse Jiryu Davis', 'email': 'jesse@mongodb.com'}

Message: CDRIVER-2558 transactions documentation
Branch: master
https://github.com/mongodb/mongo-c-driver/commit/98c3b8763db6a5f79e64a342fe18ed3edc0382c1

Comment by Githook User [ 01/Jun/18 ]

Author:

{'username': 'ajdavis', 'name': 'A. Jesse Jiryu Davis', 'email': 'jesse@mongodb.com'}

Message: CDRIVER-2558 compare results in JSON tests
Branch: master
https://github.com/mongodb/mongo-c-driver/commit/26dcd2b18a87690df89fb79388d2b384680d06ea

Comment by Githook User [ 31/May/18 ]

Author:

{'username': 'ajdavis', 'name': 'A. Jesse Jiryu Davis', 'email': 'jesse@mongodb.com'}

Message: CDRIVER-2558 transactions tests
Branch: master
https://github.com/mongodb/mongo-c-driver/commit/2bfcbe9ab118b7b82697455769779d204b22ab1a

Comment by Githook User [ 25/May/18 ]

Author:

{'username': 'ajdavis', 'name': 'A. Jesse Jiryu Davis', 'email': 'jesse@mongodb.com'}

Message: CDRIVER-2558 prepare to test transactions
Branch: master
https://github.com/mongodb/mongo-c-driver/commit/b737ba3e1712874f3caa1cde3896cfa091a885de

Comment by Githook User [ 23/May/18 ]

Author:

{'username': 'ajdavis', 'name': 'A. Jesse Jiryu Davis', 'email': 'jesse@mongodb.com'}

Message: CDRIVER-2558 fix commit/abort retry logic
Branch: master
https://github.com/mongodb/mongo-c-driver/commit/0829c769de740f17304c0c005d19110e0c9ba557

Comment by Githook User [ 22/May/18 ]

Author:

{'username': 'ajdavis', 'name': 'A. Jesse Jiryu Davis', 'email': 'jesse@mongodb.com'}

Message: CDRIVER-2558 avoid error log from agg with serverId
Branch: master
https://github.com/mongodb/mongo-c-driver/commit/aa318a7b6e9851afe12ecb6ae464cb3f20e39534

Comment by Githook User [ 22/May/18 ]

Author:

{'username': 'ajdavis', 'name': 'A. Jesse Jiryu Davis', 'email': 'jesse@mongodb.com'}

Message: CDRIVER-2558 initial transactions implementation
Branch: master
https://github.com/mongodb/mongo-c-driver/commit/9b96296aea9e98f1df368d3c1f53053cb34598b3

Comment by Githook User [ 22/May/18 ]

Author:

{'username': 'ajdavis', 'name': 'A. Jesse Jiryu Davis', 'email': 'jesse@mongodb.com'}

Message: CDRIVER-2558 remove auto_start_transaction
Branch: master
https://github.com/mongodb/mongo-c-driver/commit/68531f02a9f567a605e0129c985908db9e787cd6

Comment by Githook User [ 22/May/18 ]

Author:

{'username': 'ajdavis', 'name': 'A. Jesse Jiryu Davis', 'email': 'jesse@mongodb.com'}

Message: CDRIVER-2558 fix transaction opts
Branch: master
https://github.com/mongodb/mongo-c-driver/commit/e366338c38a1433052fc64732609dffd8651d553

Comment by Githook User [ 22/May/18 ]

Author:

{'username': 'ajdavis', 'name': 'A. Jesse Jiryu Davis', 'email': 'jesse@mongodb.com'}

Message: refactor read/writeConcern handling

Fixes CDRIVER-2650: we included readConcern twice with some secondary
mongos queries. Prepares for transactions, CDRIVER-2558
Branch: master
https://github.com/mongodb/mongo-c-driver/commit/806cddb2acde03f5462460491f38fa21332b7d97

Comment by Githook User [ 22/May/18 ]

Author:

{'username': 'ajdavis', 'name': 'A. Jesse Jiryu Davis', 'email': 'jesse@mongodb.com'}

Message: CDRIVER-2558 txn functions for client session
Branch: master
https://github.com/mongodb/mongo-c-driver/commit/c6a1715819bb639d4a06c0a2e83bdacd335f45be

Comment by Githook User [ 22/May/18 ]

Author:

{'username': 'ajdavis', 'name': 'A. Jesse Jiryu Davis', 'email': 'jesse@mongodb.com'}

Message: CDRIVER-2558 initial transactions API
Branch: master
https://github.com/mongodb/mongo-c-driver/commit/3d08f3d93d04172c90e2ae6f4370ac3166fa73f3

Comment by Githook User [ 16/May/18 ]

Author:

{'email': 'jesse@mongodb.com', 'username': 'ajdavis', 'name': 'A. Jesse Jiryu Davis'}

Message: refactor read/writeConcern handling

Fixes CDRIVER-2650: we included readConcern twice with some secondary
mongos queries. Prepares for transactions, CDRIVER-2558
Branch: transactions
https://github.com/mongodb/mongo-c-driver/commit/725fc97a2064161036d3129aeecc72f24c37f5ec

Comment by Githook User [ 16/May/18 ]

Author:

{'email': 'jesse@mongodb.com', 'username': 'ajdavis', 'name': 'A. Jesse Jiryu Davis'}

Message: CDRIVER-2558 txn functions for client session
Branch: transactions
https://github.com/mongodb/mongo-c-driver/commit/2ae05060083edec2c0f83c28a5c2a3667ce6d79f

Comment by Githook User [ 10/May/18 ]

Author:

{'name': 'A. Jesse Jiryu Davis', 'email': 'jesse@mongodb.com', 'username': 'ajdavis'}

Message: CDRIVER-2558 initial transactions API
Branch: transactions
https://github.com/mongodb/mongo-c-driver/commit/22d412e7d5d00f01e1d4cc4075a3210766effa0e

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