[DRIVERS-556] Implement Convenient API for Transactions Created: 03/Aug/18  Updated: 02/Feb/24  Resolved: 14/Apr/23

Status: Closed
Project: Drivers
Component/s: None
Fix Version/s: None

Type: Epic Priority: Major - P3
Reporter: Rathi Gnanasekaran Assignee: Unassigned
Resolution: Done Votes: 1
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
depends on RUBY-1574 Implement Convenient API for Transact... Closed
depends on CDRIVER-2870 Implement Convenient API for Transact... Closed
depends on CSHARP-2426 Implement Convenient API for Transact... Closed
depends on CXX-1682 Implement Convenient API for Transact... Closed
depends on GODRIVER-621 Implement Convenient API for Transact... Closed
depends on GODRIVER-734 POC : Convenient API for Transactions Closed
depends on JAVA-3067 Implement Convenient API for Transact... Closed
depends on JAVA-3546 Implement Convenient API for Transact... Closed
depends on MOTOR-280 Implement Convenient API for Transact... Closed
depends on NODE-1741 Implement Convenient API for Transact... Closed
depends on PHPLIB-468 Implement Convenient API for Transact... Closed
depends on PYTHON-1671 Implement Convenient API for Transact... Closed
depends on RUST-107 Implement Convenient API for Transact... Closed
depends on CDRIVER-2908 POC : Convenient API for Transactions Closed
depends on JAVA-3128 POC of convenient API for transactions Closed
depends on NODE-1877 withTransaction() should retry commit... Closed
depends on RUBY-1733 withTransaction() should retry commit... Closed
Gantt Dependency
has to be done before DRIVERS-608 withTransaction() should retry commit... Closed
Related
related to JAVA-3539 Implement convenient reactive API for... Backlog
related to DRIVERS-623 Use runOn syntax to specify transacti... Closed
is related to DRIVERS-1934 withTransaction API retries too frequ... Backlog
Cost Threshold %: 100
Driver Compliance:
Key Status/Resolution FixVersion
NODE-1741 Fixed 3.2.0
JAVA-3546 Duplicate
PYTHON-1671 Fixed 3.9
CSHARP-2426 Fixed 2.9.0
PERL-1022 Fixed 2.2.0
JAVA-3067 Fixed 3.11.0
CXX-1682 Fixed 3.5.0
PHPLIB-468 Fixed 1.5.0
MOTOR-280 Fixed 2.1
GODRIVER-621 Fixed 1.1.0
CDRIVER-2870 Fixed 1.15.0
RUBY-1574 Fixed 2.8.0.rc0, 2.7.1
CDRIVER-2908 Fixed 1.14.0
GODRIVER-734 Won't Fix
JAVA-3128 Done
RUST-107 Fixed 2.5.0
NODE-1877 Fixed 3.2.0
RUBY-1733 Fixed 2.10.0.rc0
SWIFT-574 Won't Do

 Description   


 Comments   
Comment by Githook User [ 08/Jan/19 ]

Author:

{'username': 'jmikola', 'email': 'jmikola@gmail.com', 'name': 'Jeremy Mikola'}

Message: DRIVERS-556: Convenient API for Transactions spec tests (#435)

  • Add additional withTransaction tests
  • Rename spec directory
  • Test that commit retry only overwrites WC's w option
  • Document clientOptions in test README
  • withTransaction can still succeed if callback aborts
  • Use consistent result.error fields from transactions spec tests
  • Add wtimeout error test and fix other WC error fail points
  • Reorganize callback/commit tests and add WC and transient error commit tests
  • Add prose tests for callback error and return value behavior
  • Transient error on commit should retry entire transaction
  • Fix readConcern APM assertions

Per the txn spec, only the initial command in a transaction can include a readConcern. Furthermore, afterClusterTime would only be specified if the client session is re-used for a second transaction (only one of our tests).

  • Use more robust assertions for extra ops after a transaction

Asserting a value for txnNumber assumes that retryWrites=true, which may not be the case. Instead, ignore that field entirely and just assert that autocommit is not found. Combined with asserting that startTransaction is not found, we effectively assert that the command is not part of a transaction.

  • Expect abortTransaction after non-transient error

Per the spec, withTransaction should abort if the callback reports an error and the session is in the "starting" or "in progress" state.

  • Skip commit-retry tests pending SPEC-1185
  • Fix expectations for commit TransientTransactionError tests

Since drivers internally retry commitTransaction, these tests should expect an additional command before the entire transaction is retried. The fail point must also trigger a second time to overcome the driver's internal retry behavior and allow withTransaction() to retry the entire transaction.

  • Expect readConcern.afterClusterTime when startTransaction is retried
  • Write op is still applied after a write concern error

This also consolidates repeated test content with YAML references.

  • Omit closeConnection for writeConcernError fail points
  • Skip write concern timeout test pending SPEC-1197
  • PreparedTransactionInProgress TransientTransactionError requires 4.1.6
  • Add test for retrying WriteConcernFailed non-timeout error
Generated at Thu Feb 08 08:21:48 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.