Operations on a failed transaction can succeed

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Unresolved
    • Priority: Minor - P4
    • None
    • Affects Version/s: None
    • Component/s: Transactions
    • None
    • Storage Engines, Storage Engines - Transactions
    • SE Transactions - 2025-08-29
    • 5

      During randomized API testing for an ongoing MongoDB Research project, we found that continuing to issue operations on a failed transaction will succeed in some cases. As in, an insert fails with WT_ROLLBACK, and then another insert on that same transaction will report success.

      Here is code to reproduce the issue, courtesy of Peter Macko:

      self.session.create(self.uri, 'key_format=S,value_format=S')
      
      session1 = self.conn.open_session()
      cursor1 = session1.open_cursor(self.uri, None)
      session1.begin_transaction()
      cursor1['A'] = 'A1'
      
      session2 = self.conn.open_session()
      session2.begin_transaction()
      cursor2 = session2.open_cursor(self.uri, None)
      cursor2.set_key('A')
      cursor2.set_value('A2')
      cursor2.insert() # <----- fails with WT_ROLLBACK as expected
      
      cursor2.set_key('B')
      cursor2.set_value('B2')
      cursor2.insert() # <----- succeeds, even though the transaction has already failed
      
      session1.commit_transaction()
      session2.commit_transaction()   # <----- fails with "failed transaction requires rollback: Invalid argument"
      session2.rollback_transaction() # <----- fails with "only permitted in a running transaction: Invalid argument"
      
      session1.close()
      session2.close() 

              Assignee:
              Vamsi Boyapati
              Reporter:
              Finn Hackett (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Created:
                Updated: