Uploaded image for project: 'WiredTiger'
  1. WiredTiger
  2. WT-8077

Mark the page dirty once the prepared updates are resolved

    • 8
    • Storage - Ra 2021-09-20

      Running the test/checkpoint with the following debug mode configuration leads to the test application hangs in verify due to a prepare conflict error.

      #define DEBUG_MODE_CFG ",eviction_dirty_trigger=1,debug_mode=(eviction=true,table_logging=true,disable_lru=true,update_restore_evict=true),verbose=(recovery)"
      

      From the dump of the database files, the committed prepared transaction updates are not resolved in some tables.

      00.wt:

              K {22}
              value: len 53, start: (0, 2997)/(0, 2997)/0 stop: (0, 0)/(4294967295, 4294967295)/18446744073709551605, prepared
              V {0000000000000000000000000000000000000000000000037731}
              value {0000000000000000000000000000000000000000000000037731}
              txn id 0, start_ts (0, 2997), prepare in-progress
      

      01.wt:

              K {22}
              value: len 53, start: (0, 2997)/(0, 2997)/0 stop: (0, 0)/(4294967295, 4294967295)/18446744073709551605, prepared
              V {0000000000000000000000000000000000000000000000037731}
              value {0000000000000000000000000000000000000000000000037731}
              txn id 0, start_ts (0, 2997), prepare in-progress
      

      02.wt:

              K {22}
              value: len 53, start: (0, 2999)/(0, 2997)/0 stop: (0, 0)/(4294967295, 4294967295)/18446744073709551605
              V {0000000000000000000000000000000000000000000000037731}
      

      The above key 22 is inserted by a prepared transaction and committed, but that commit is missed in tables 00.wt and 01.wt files.

      The missing prepared updates occur in the following sequence of operations:

      1. The transaction has performed a couple of operations and mark it as prepared.
      2. Due to the cache pressure, the eviction is triggered on a page where prepared updates are present.
      3. Multiple page blocks are written as per the reconciliation due to the bigger page size and the reconciliation is successful.
      4. The eviction process proceeds with finalizing the split at the end of eviction and it failed to evict the page after marking the page as clean.
      5. The prepared transaction gets committed and all the prepared updates are resolved.
      6. Later the eviction process was successfully able to evict the page and this time it doesn't perform any reconciliation due to the page being marked as clean. The eviction proceeds with the earlier reconciled images that have the prepared transaction not resolved.
      7. Any search for these keys loads the page image into the memory where the prepared updates are not resolved and lead to PREPARE_CONFLICT error.
         

            Assignee:
            haribabu.kommi@mongodb.com Haribabu Kommi
            Reporter:
            haribabu.kommi@mongodb.com Haribabu Kommi
            Votes:
            0 Vote for this issue
            Watchers:
            9 Start watching this issue

              Created:
              Updated:
              Resolved: