-
Type: Spec Change
-
Resolution: Unresolved
-
Priority: Major - P3
-
None
-
Component/s: Transactions
-
None
-
Needed
The tests added in SPEC-1125 highlight some confusion and easy misinterpretation of the write concern rules in the transactions spec. We should update the spec to make the rules more clear and concise. Adding an example might do the trick.
This is what is indented to be supported:
with session.start_transaction():
w_0_coll = db.get_collection("w_0_coll", writeConcern=WriteConcern(w=0))
# This is allowed, the write concern of the transaction is used instead of w=0.
w_0_coll.insert_one({}, session=session)
This is different from starting a transaction with an unacknowledged write concern which is not allowed (SPEC-1100):
# Errors with "transactions do not support unacknowledged write concern: WriteConcern(w=0)"
session.start_transaction(writeConcern=WriteConcern(w=0))