Uploaded image for project: 'Drivers'
  1. Drivers
  2. DRIVERS-2134

Clarify write concern rules in the transactions spec

    • Type: Icon: Spec Change Spec Change
    • Resolution: Unresolved
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Component/s: Transactions
    • Labels:
      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))
      

            Assignee:
            Unassigned Unassigned
            Reporter:
            shane.harvey@mongodb.com Shane Harvey
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: