-
Type:
Bug
-
Resolution: Fixed
-
Priority:
Unknown
-
Affects Version/s: None
-
Component/s: None
-
None
-
Fully Compatible
-
Dotnet Drivers
-
Not Needed
The BulkWrite command throws a ClientBulkWriteException when there is a conflict issue. However, this exception does not include the TransientTransactionError label, which is only present in the InnerException.
As a result, the session.WithTransactionAsync method does not automatically retry the operation, as it should.
Steps to Reproduce:
- Execute a BulkWrite operation inside a session.WithTransactionAsync block.
- Introduce a transient conflict error (e.g., a write conflict).
- Observe that the operation fails without retrying, even though retries are expected in this scenario.
Expected Behavior:
The ClientBulkWriteException should include the TransientTransactionError label to ensure session.WithTransactionAsync retries the operation as intended.
Actual Behavior:
The TransientTransactionError label is present only in the InnerException, and the session.WithTransactionAsync method does not retry the operation.
Created from community post: https://www.mongodb.com/community/forums/t/retry-does-not-work-with-bulkwrite-operations-within-the-session/308012