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
    • $i18n.getText("admin.common.words.hide")
      Key Status/Resolution FixVersion
      CDRIVER-5788 Backlog
      CXX-3161 Backlog
      CSHARP-5392 Backlog
      GODRIVER-3410 Backlog
      JAVA-5684 Backlog
      NODE-6492 In Code Review
      MOTOR-1402 Duplicate
      PYTHON-4938 Fixed 4.12
      PHPLIB-1580 Backlog
      RUBY-3582 Backlog
      RUST-2085 Backlog
      $i18n.getText("admin.common.words.show")
      #scriptField, #scriptField *{ border: 1px solid black; } #scriptField{ border-collapse: collapse; } #scriptField td { text-align: center; /* Center-align text in table cells */ } #scriptField td.key { text-align: left; /* Left-align text in the Key column */ } #scriptField a { text-decoration: none; /* Remove underlines from links */ border: none; /* Remove border from links */ } /* Add green background color to cells with FixVersion */ #scriptField td.hasFixVersion { background-color: #00FF00; /* Green color code */ } #scriptField td.willNotDo { background-color: #FF0000; /* Red color code */ } /* Center-align the first row headers */ #scriptField th { text-align: center; } Key Status/Resolution FixVersion CDRIVER-5788 Backlog CXX-3161 Backlog CSHARP-5392 Backlog GODRIVER-3410 Backlog JAVA-5684 Backlog NODE-6492 In Code Review MOTOR-1402 Duplicate PYTHON-4938 Fixed 4.12 PHPLIB-1580 Backlog RUBY-3582 Backlog RUST-2085 Backlog

      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:
            durran.jordan@mongodb.com Durran Jordan
            Reporter:
            shane.harvey@mongodb.com Shane Harvey
            Andreas Braun Andreas Braun
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: