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

db and coll handles write concern and read concern are silently ignored in transactions

    • Type: Icon: Spec Change Spec Change
    • Resolution: Unresolved
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Component/s: Transactions
    • Labels:
      None
    • Needed

      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

            Assignee:
            Unassigned Unassigned
            Reporter:
            henrik.ingo@mongodb.com Henrik Ingo (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            8 Start watching this issue

              Created:
              Updated: