ExportXMLWordPrintableJSON

    • Storage Engines - Foundations
    • 173.633
    • SE Foundations - 2026-10-13
    • 3

      Problem:

      Rolling back a prepared insert before the table is fully published can trigger a “leaked prepared update” assertion during eviction.

      Context:

      This bug was found while running the Python suite with schema publishing enabled as part of WT-18031. The failing test is:

      test_prepare42.test_prepare42.test_prepare_insert_rollback

      The failure requires preserve_prepared=true. This setting allows a checkpoint to preserve a prepared transaction when the checkpoint timestamp is earlier than the transaction’s rollback timestamp.

      AI suggests that this is a reproducer:

      @disagg_test_class
      class test_layered_prepare12(wttest.WiredTigerTestCase):
          uri = 'layered:prepare12'
          conn_config = (
              'disaggregated=(role=leader),'
              'precise_checkpoint=true,preserve_prepared=true'
          )
          scenarios = make_scenarios(gen_disagg_storages(disagg_only=True))
      
          def test_eviction_after_checkpoint_preserves_prepare(self):
              self.conn.set_timestamp(
                  'oldest_timestamp=1,stable_timestamp=1,stable_disaggregated_schema_epoch=1')
              self.session.create(self.uri, 'key_format=i,value_format=S')
              self.session.publish(self.uri, 'disaggregated=(schema_epoch=2)')
              self.conn.set_timestamp('stable_disaggregated_schema_epoch=2')
      
              with wttest.open_cursor(self.session, self.uri) as cursor:
                  self.session.begin_transaction()
                  cursor[1] = 'value'
                  self.session.commit_transaction('commit_timestamp=2')
                  self.conn.set_timestamp('stable_timestamp=2')
      
                  self.session.begin_transaction()
                  cursor[2] = 'prepared value'
                  self.session.prepare_transaction('prepare_timestamp=3,prepared_id=1')
              self.session.rollback_transaction('rollback_timestamp=5')
      
              # Checkpoint the prepared state before attempting eviction.
              self.conn.set_timestamp('stable_timestamp=4')
              self.session.checkpoint()
      
              with wttest.open_cursor(
                      self.session, self.uri, config='debug=(release_evict)') as cursor:
                  cursor.set_key(1)
                  self.assertEqual(cursor.search(), 0)
                  self.assertEqual(cursor.reset(), 0)
      
              self.conn.set_timestamp('stable_timestamp=6')
      

      Alternatively the test case (test_prepare_insert_rollback) with the hook can be used as the reproducer.

      Definition of Done:

      • Investigate and apply the bug fix for this scenario
      • Add regression tests covering this particular scenario
      • Remove the skip in test_prepare42

            Assignee:
            Salman Javed
            Reporter:
            Krishen Chovhan
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: