-
Type: Spec Change
-
Resolution: Won't Fix
-
Priority: Major - P3
-
None
-
Component/s: Transactions
As elaborated in PYTHON-1668, it turns out that if I set write_concern or read_concern for the db or collection handles, they will be silently ignored.
If I understand the background to this situation correctly: A transaction can mix several db and coll handles in a single transaction. They can have different write_concerns and read_concerns, yet the transaction obviously can only have one and the same, as those are properties of a transaction. The solution is to silently ignore those settings for db and coll objects inside a transaction.
For users who won't read the documentation, this is not obvious and I fear many will not get the durability and consistency they expected. (Just like I didn't.) This is essentially a data corruption bug - even if a UX kind of that.
I would suggest the following instead:
db and coll objects inside a transaction MUST have write_concern and read_concern set to either:
- defaults/unset
- matching those of the transaction
- if neither of the above, raise an error
- is related to
-
NODE-6260 Add alternative transaction API that doesn't require passing a session to each method
- Backlog
- related to
-
PYTHON-1668 Expand transaction documentation for configuring write_concern and read_concern
- Backlog