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

Assert gets hit when inserting an update to history store after an aborted prepared update

    • Type: Icon: Bug Bug
    • Resolution: Duplicate
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None
    • Labels:
      None
    • 5

      The following assert gets hit when inserting data into the history store.

      #ifdef HAVE_DIAGNOSTIC
                  if (cmp == 0) {
                      WT_ERR(cursor->get_value(cursor, &hs_stop_durable_ts_diag, &durable_timestamp_diag,
                        &upd_type_full_diag, existing_val));
                      WT_ERR(__wt_compare(session, NULL, existing_val, hs_value, &cmp));
                      if (cmp == 0)
                          WT_ASSERT(session,
                            start_time_point->txnid == WT_TXN_NONE ||
                              start_time_point->txnid != hs_cbt->upd_value->tw.start_txn ||
                              start_time_point->ts != hs_cbt->upd_value->tw.start_ts);
                      counter = hs_counter + 1;
                  }
      #else
                  if (cmp == 0)
                      counter = hs_counter + 1;
      #endif
      

      Both the inserting record and the existing history store record are from the same transaction and same timestamp.

      (gdb) p start_time_point   
      $1 = (WT_HS_TIME_POINT *) 0x7f8bbaa75d80
      (gdb) p *start_time_point
      $2 = {
        ts = 6896706622463148044, 
        durable_ts = 6896706622463148044, 
        txnid = 580
      }
      (gdb) p hs_cbt->upd_value->tw
      $3 = {
        durable_start_ts = 6896706622463148044, 
        start_ts = 6896706622463148044, 
        start_txn = 580, 
        durable_stop_ts = 0, 
        stop_ts = 0, 
        stop_txn = 0, 
        prepare = 0 '\000'
      }
      

      The existing history store already have a global visible tombstone and it is missed to ignored due to which the assert gets fired.

      Symptom:

       [2020/11/25 07:03:08.675]     [1606287786:773799][6362:0x7f49db065700], file:WiredTigerHS.wt, eviction-server: __hs_insert_record_with_btree, 246: start_time_point->txnid == WT_TXN_NONE || start_time_point->txnid != hs_cbt->upd_value->tw.start_txn || start_time_point->ts != hs_cbt->upd_value->tw.start_ts
      __hs_insert_record_with_btree, 233: tw->start_txn == WT_TXN_NONE || tw->start_txn != hs_cbt->upd_value->tw.start_txn || tw->start_ts != hs_cbt->upd_value->tw.start_ts
       [2020/11/25 07:03:08.675]     [1606287786:773840][6362:0x7f49db065700], file:WiredTigerHS.wt, eviction-server: __wt_abort, 28: aborting WiredTiger library 

            Assignee:
            backlog-server-storage-engines [DO NOT USE] Backlog - Storage Engines Team
            Reporter:
            haribabu.kommi@mongodb.com Haribabu Kommi
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: