Following on from my comment in WT-6276,
I think the issue is in bt_page.c, where we allocate the tombstone and overwrite the size variable, we should increase total size prior with the previous size variable prior to overwriting it.:
WT_ERR(__wt_upd_alloc(session, value, WT_UPDATE_STANDARD, &upd, &size)); upd->durable_ts = unpack.tw.durable_start_ts; upd->start_ts = unpack.tw.start_ts; upd->txnid = unpack.tw.start_txn; /* * Instantiating both update and tombstone if the prepared update is a tombstone. * This is required to ensure that written prepared delete operation must be removed * from the data store, when the prepared transaction gets rollback. */ if (WT_TIME_WINDOW_HAS_STOP(&unpack.tw)) { WT_ERR(__wt_upd_alloc_tombstone(session, &tombstone, &size)); tombstone->durable_ts = WT_TS_NONE; tombstone->start_ts = unpack.tw.stop_ts; tombstone->txnid = unpack.tw.stop_txn; tombstone->prepare_state = WT_PREPARE_INPROGRESS; F_SET(tombstone, WT_UPDATE_PREPARE_RESTORED_FROM_DISK); tombstone->next = upd; } else { upd->durable_ts = WT_TS_NONE; upd->prepare_state = WT_PREPARE_INPROGRESS; F_SET(upd, WT_UPDATE_PREPARE_RESTORED_FROM_DISK); tombstone = upd; }
- related to
-
WT-6276 Add size first to cache and btree to avoid the race that can cause cache size underflow
- Closed