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

Shouldn't squash updates from the same transaction but with different timestamps onto data store

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Open
    • Priority: Major - P3
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: Backlog
    • Component/s: None
    • Labels:
      None

      Description

                      /*
                       * 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).

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              backlog-server-storage-engines Backlog - Storage Engines Team
              Reporter:
              chenhao.qu Chenhao Qu
              Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

                Dates

                Created:
                Updated: