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:
- The transaction has performed a couple of operations and mark it as prepared.
- Due to the cache pressure, the eviction is triggered on a page where prepared updates are present.
- Multiple page blocks are written as per the reconciliation due to the bigger page size and the reconciliation is successful.
- 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.
- The prepared transaction gets committed and all the prepared updates are resolved.
- 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.
- 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.