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

Fix the assert with no more than one aborted update in chain

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • WT10.0.0, 4.4.0-rc5, 4.7.0
    • Affects Version/s: None
    • Component/s: None
    • None
    • 2
    • Storage - Ra 2020-05-18

      I'm seeing this failure regularly:

      format.sh: /data/bostic/RUNDIR.4 log:
          t: process 92805 running
          [1588803042:642563][92805:0x7fa3a17b8700], t, file:wt.wt, WT_SESSION.rollback_transaction: __txn_fixup_prepared_update, 722: upd->ne
      xt != NULL && upd->next->next == NULL && upd->next->txnid == WT_TXN_ABORTED
          [1588803042:642598][92805:0x7fa3a17b8700], t, file:wt.wt, WT_SESSION.rollback_transaction: __wt_abort, 22: process ID 92805: waiting
       for debugger...
      
      (gdb) where
      #0  0x00007fa3a8cf403f in __GI___select (nfds=0, readfds=0x0, writefds=0x0, exceptfds=0x0,
          timeout=0x7fa3a17b7b50) at ../sysdeps/unix/sysv/linux/select.c:41
      #1  0x0000555cc247fe11 in __wt_sleep (seconds=100, micro_seconds=0) at src/os_posix/os_sleep.c:30
      #2  0x0000555cc24755e1 in __wt_abort (session=0x7fa3a97e9e30) at src/os_common/os_abort.c:26
      #3  0x0000555cc24dbc4c in __txn_fixup_prepared_update (session=0x7fa3a97e9e30, op=0x7fa390aa48f0,
          cursor=0x7fa390c32210, commit=false) at src/txn/txn.c:721
      #4  0x0000555cc24dc39b in __txn_resolve_prepared_op (session=0x7fa3a97e9e30, op=0x7fa390aa48f0,
          commit=false, cursorp=0x7fa3a17b7d70) at src/txn/txn.c:894
      #5  0x0000555cc24ddca9 in __wt_txn_rollback (session=0x7fa3a97e9e30, cfg=0x7fa3a17b7e10)
          at src/txn/txn.c:1531
      #6  0x0000555cc24b87d0 in __session_rollback_transaction (wt_session=0x7fa3a97e9e30, config=0x0)
          at src/session/session_api.c:1735
      #7  0x0000555cc23dc746 in rollback_transaction (tinfo=0x555cc4a1dc10) at ops.c:485
      #8  0x0000555cc23ddd61 in ops (arg=0x555cc4a1dc10) at ops.c:1000
      #9  0x00007fa3a8fd56db in start_thread (arg=0x7fa3a17b8700) at pthread_create.c:463
      #10 0x00007fa3a8cfe88f in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95
      (gdb) frame 3
      #3  0x0000555cc24dbc4c in __txn_fixup_prepared_update (session=0x7fa3a97e9e30, op=0x7fa390aa48f0,
          cursor=0x7fa390c32210, commit=false) at src/txn/txn.c:721
      721             WT_ASSERT(session,
      (gdb) list 710,730
      710              */
      711             F_SET(upd, WT_UPDATE_RESTORED_FOR_ROLLBACK);
      712             
      713             /*
      714              * There should be only one aborted prepared update in the list, append it after the new
      715              * update.
      716              */
      717             if (cbt->ins != NULL)
      718                 upd->next = cbt->ins->upd;
      719             else if (cbt->ref->page->modify != NULL && cbt->ref->page->modify->mod_row_update != NULL)
      720                 upd->next = cbt->ref->page->modify->mod_row_update[cbt->slot];
      721             WT_ASSERT(session,
      722               upd->next != NULL && upd->next->next == NULL && upd->next->txnid == WT_TXN_ABORTED);
      723               
      724             /* Append a tombstone if the stop timestamp exists. */
      725             if (hs_stop_ts != WT_TS_MAX) {
      726                 WT_ERR(__wt_upd_alloc(session, NULL, WT_UPDATE_TOMBSTONE, &tombstone, NULL));
      727                 tombstone->durable_ts = hs_stop_ts;
      728                 tombstone->start_ts = hs_stop_ts;  
      729                 tombstone->txnid = WT_TXN_NONE;    
      730                 tombstone->next = upd;
      

      Here's the WT_UPDATE list:

      (gdb) yyy
      $4 = {
        txnid = 0,
        durable_ts = 0,
        start_ts = 0,
        next = 0x7fa3900dc3c0,
        size = 20,
        type = 3 '\003',
        prepare_state = 0 '\000',
        flags = 2 '\002',
        data = 0x7fa390728917 "0000784291/LMNOPQRST"
      }
      $5 = {
        txnid = 18446744073709551615,
        durable_ts = 0,
        start_ts = 40154,
        next = 0x7fa39018cbd0,
        size = 45,
        type = 3 '\003',
        prepare_state = 1 '\001',
        flags = 0 '\000',
        data = 0x7fa3900dc3e7 "0000784291/LMNOPQRST"
      }
      $6 = {
        txnid = 18446744073709551615,
        durable_ts = 0,
        start_ts = 0,
        next = 0x0,
        size = 0,
        type = 2 '\002',
        prepare_state = 0 '\000',
        flags = 0 '\000',
        data = 0x7fa39018cbf7 ""
      }
      

            Assignee:
            haribabu.kommi@mongodb.com Haribabu Kommi
            Reporter:
            keith.bostic@mongodb.com Keith Bostic (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated:
              Resolved: