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

Panic if we fail __wt_txn_update_oldest in __wt_update_serial

    • 3
    • Storage - Ra 2022-05-30

      __wt_update_serial we have this code after we have inserted update to the update chain:

           * We would like to call __wt_txn_update_oldest only in the event that there are further updates
           * to this page, the check against WT_TXN_NONE is used as an indicator of there being further
           * updates on this page.
          if ((txn = page->modify->obsolete_check_txn) != WT_TXN_NONE) {
              obsolete_timestamp = page->modify->obsolete_check_timestamp;
              if (!__wt_txn_visible_all(session, txn, obsolete_timestamp)) {
                  /* Try to move the oldest ID forward and re-check. */
                  WT_RET(__wt_txn_update_oldest(session, 0));
                  if (!__wt_txn_visible_all(session, txn, obsolete_timestamp))
                      return (0);
              page->modify->obsolete_check_txn = WT_TXN_NONE;

      This is problematic as it can return a failure (ebusy) but actually we have inserted the update to the update chain. The caller of the function will then wrongly handle the error by freeing the update already inserted to the update chain.

            chenhao.qu@mongodb.com Chenhao Qu
            chenhao.qu@mongodb.com Chenhao Qu
            0 Vote for this issue
            4 Start watching this issue