-
Type: Bug
-
Resolution: Duplicate
-
Priority: Major - P3
-
None
-
Affects Version/s: None
-
Component/s: None
-
None
/* * Loop until a valid update from a different transaction is found in the update * list. */ while (upd->next != NULL) { if (upd->next->txnid == WT_TXN_ABORTED) upd = upd->next; else if (upd->next->txnid != WT_TXN_NONE && tombstone->txnid == upd->next->txnid) { upd = upd->next; /* Save the latest update from the same transaction. */ if (same_txn_valid_upd == NULL) same_txn_valid_upd = upd; } else break; }
The above code squashes the updates on the same key from the same transaction if the newest update of the transaction is a tombstone. For example:
T@txn10 -> U@txn10 -> U@txn8
We will write T@txn10 as the stop time point and U@txn8 to the data store. However, we don't consider the case that T@txn10 may have a different timestamp to U@txn10. In this case, we shouldn't squash the transaction.
T@(txn10, ts 100) -> U@(txn10, ts 80) -> U@(txn8, ts 60)
We should write T@(txn10, ts 100) as the stop time point, U@(txn10, ts 80) to the data store, and U@(txn8, ts 60) to the history store. Because if we read with ts 90, we should see U@(txn10, ts 80) instead of U@(txn8, ts 60).