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

Add assert to ensure that we don't select the update already written to HS to write to DS

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

      In a local test format run, I hit the following assert:

      format.sh: /home/chenhaoqu/work/wiredtiger/test/format/RUNDIR.71 log:
          t: process 40559 running
          [1582855541:785427][40559:0x7f2e2a7fc700], t, file:wt.wt, WT_SESSION.checkpoint: __rec_append_orig_value, 107: last_committed_upd == NULL || last_committed_upd->start_ts >= unpack->start_ts
          [1582855541:785468][40559:0x7f2e2a7fc700], t, file:wt.wt, WT_SESSION.checkpoint: __wt_abort, 28: aborting WiredTiger library
      format.sh: /home/chenhaoqu/work/wiredtiger/test/format/RUNDIR.71/CONFIG:
      

      Looks like we are choosing a version which is already in history store to write to the disk image in checkpoint:

      /(gdb) bt
      #0  __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:51
      #1  0x00007f2e3e708801 in __GI_abort () at abort.c:79
      #2  0x0000000000499a30 in __wt_abort (session=0x7f2e3f6f2230) at ../src/os_common/os_abort.c:30
      #3  0x00000000005f7b99 in __rec_append_orig_value (session=0x7f2e3f6f2230, page=0x7f2e2030fa10, upd=0x7f2e208ea070, unpack=0x7f2e2a7fb790)
          at ../src/reconcile/rec_visibility.c:106
      #4  0x00000000005f8ab8 in __wt_rec_upd_select (session=0x7f2e3f6f2230, r=0x7f2e14004980, ins=0x0, ripcip=0x7f2e2030fba0, vpack=0x7f2e2a7fb790, upd_select=0x7f2e2a7fb740)
          at ../src/reconcile/rec_visibility.c:488
      #5  0x00000000005f5f43 in __wt_rec_row_leaf (session=0x7f2e3f6f2230, r=0x7f2e14004980, pageref=0xae0d70, salvage=0x0) at ../src/reconcile/rec_row.c:799
      #6  0x00000000004b4a97 in __reconcile (session=0x7f2e3f6f2230, ref=0xae0d70, salvage=0x0, flags=5, page_lockedp=0x7f2e2a7fba0e) at ../src/reconcile/rec_write.c:176
      #7  0x00000000004b4729 in __wt_reconcile (session=0x7f2e3f6f2230, ref=0xae0d70, salvage=0x0, flags=5) at ../src/reconcile/rec_write.c:87
      #8  0x000000000058143d in __wt_sync_file (session=0x7f2e3f6f2230, syncop=WT_SYNC_CHECKPOINT) at ../src/btree/bt_sync.c:559
      #9  0x0000000000502f28 in __checkpoint_tree (session=0x7f2e3f6f2230, is_checkpoint=true, cfg=0x7f2e2a7fbdd0) at ../src/txn/txn_ckpt.c:1610
      #10 0x0000000000503253 in __checkpoint_tree_helper (session=0x7f2e3f6f2230, cfg=0x7f2e2a7fbdd0) at ../src/txn/txn_ckpt.c:1718
      #11 0x00000000004ff402 in __checkpoint_apply_to_dhandles (session=0x7f2e3f6f2230, cfg=0x7f2e2a7fbdd0, op=0x5031c4 <__checkpoint_tree_helper>) at ../src/txn/txn_ckpt.c:199
      #12 0x000000000050100b in __txn_checkpoint (session=0x7f2e3f6f2230, cfg=0x7f2e2a7fbdd0) at ../src/txn/txn_ckpt.c:864
      #13 0x0000000000501bff in __txn_checkpoint_wrapper (session=0x7f2e3f6f2230, cfg=0x7f2e2a7fbdd0) at ../src/txn/txn_ckpt.c:1076
      #14 0x0000000000501d78 in __wt_txn_checkpoint (session=0x7f2e3f6f2230, cfg=0x7f2e2a7fbdd0, waiting=true) at ../src/txn/txn_ckpt.c:1133
      #15 0x00000000004da6e6 in __session_checkpoint (wt_session=0x7f2e3f6f2230, config=0x60b40d "drop=(all)") at ../src/session/session_api.c:1971
      #16 0x00000000004108a9 in checkpoint (arg=0x0) at ../../../test/format/util.c:547
      #17 0x00007f2e3eee56db in start_thread (arg=0x7f2e2a7fc700) at pthread_create.c:463
      #18 0x00007f2e3e7e988f in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95
      (gdb) f 3
      #3  0x00000000005f7b99 in __rec_append_orig_value (session=0x7f2e3f6f2230, page=0x7f2e2030fa10, upd=0x7f2e208ea070, unpack=0x7f2e2a7fb790)
          at ../src/reconcile/rec_visibility.c:106
      106	        WT_ASSERT(
      (gdb) p upd
      $1 = (WT_UPDATE *) 0x7f2e208ea070
      (gdb) p *upd
      $2 = {txnid = 20499, durable_ts = 33201, start_ts = 33201, next = 0x0, size = 48, type = 3 '\003', prepare_state = 0 '\000', flags = 1 '\001',
        data = 0x7f2e208ea097 "0000097289/LMNOPQRST"}
      (gdb) p last_committed_upd
      $3 = (WT_UPDATE *) 0x7f2e208ea070
      (gdb) p *last_committed_upd
      $4 = {txnid = 20499, durable_ts = 33201, start_ts = 33201, next = 0x0, size = 48, type = 3 '\003', prepare_state = 0 '\000', flags = 1 '\001',
        data = 0x7f2e208ea097 "0000097289/LMNOPQRST"}
      (gdb) p *unpack
      $5 = {cell = 0x7f2e203c0ad6, v = 0, start_ts = 34936, start_txn = 21563, stop_ts = 18446744073709551615, stop_txn = 18446744073709551605, newest_durable_ts = 0,
        oldest_start_ts = 0, oldest_start_txn = 0, newest_stop_ts = 18446744073709551615, newest_stop_txn = 18446744073709551605, data = 0x7f2e203c0ae0, size = 50, __len = 60,
        prefix = 0 '\000', raw = 128 '\200', type = 128 '\200', flags = 0 '\000'}
      (gdb) f 4
      #4  0x00000000005f8ab8 in __wt_rec_upd_select (session=0x7f2e3f6f2230, r=0x7f2e14004980, ins=0x0, ripcip=0x7f2e2030fba0, vpack=0x7f2e2a7fb790, upd_select=0x7f2e2a7fb740)
          at ../src/reconcile/rec_visibility.c:488
      488	        WT_ERR(__rec_append_orig_value(session, page, upd_select->upd, vpack));
      (gdb) p first_upd
      $6 = (WT_UPDATE *) 0x7f2e24123620
      (gdb) p *first_upd
      $7 = {txnid = 21563, durable_ts = 34936, start_ts = 34936, next = 0x7f2e208ea070, size = 50, type = 3 '\003', prepare_state = 0 '\000', flags = 0 '\000',
        data = 0x7f2e24123647 "0000097289/LMNOPQRST"}
      (gdb) p upd_select
      $8 = (WT_UPDATE_SELECT *) 0x7f2e2a7fb740
      (gdb) p upd_select->upd
      $9 = (WT_UPDATE *) 0x7f2e208ea070
      (gdb) p *upd_select->upd
      $10 = {txnid = 20499, durable_ts = 33201, start_ts = 33201, next = 0x0, size = 48, type = 3 '\003', prepare_state = 0 '\000', flags = 1 '\001',
        data = 0x7f2e208ea097 "0000097289/LMNOPQRST"}
      (gdb) p *first_upd
      $11 = {txnid = 21563, durable_ts = 34936, start_ts = 34936, next = 0x7f2e208ea070, size = 50, type = 3 '\003', prepare_state = 0 '\000', flags = 0 '\000',
        data = 0x7f2e24123647 "0000097289/LMNOPQRST"}
      (gdb) p *first_upd->next
      $12 = {txnid = 20499, durable_ts = 33201, start_ts = 33201, next = 0x0, size = 48, type = 3 '\003', prepare_state = 0 '\000', flags = 1 '\001',
        data = 0x7f2e208ea097 "0000097289/LMNOPQRST"}
      

            Assignee:
            backlog-server-storage-engines [DO NOT USE] Backlog - Storage Engines Team
            Reporter:
            chenhao.qu@mongodb.com Chenhao Qu
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: