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

Restore assert that trees being discarded are not marked dirty



    • Type: Technical Debt
    • Status: Closed
    • Priority: Minor - P4
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: WT3.2.2, 4.5.1, 4.4.0-rc4
    • Component/s: None
    • Labels:
    • Story Points:
    • Sprint:
      Storage - Tora 2020-04-20, Storage - Tora 2020-05-04


      I hit this assert on the relevant history feature branch, but I think it might be possible to do so on develop as well.

      I spent some time debugging it on both the branches, I think the assert hits only on the feature branch mostly because we set pages to deleted way more often. It is worthwhile to spend time on debugging whether this assert is applicable on develop. Hence I am creating this ticket.

      More details in this comment on WT-5228. I am pasting some content for completion:

      Assert checks if the dhandle is not set to dead when dirtying a page, in the function __wt_page_only_modify_set:

      WT_ASSERT(session, !F_ISSET(session->dhandle, WT_DHANDLE_DEAD))


      #0  __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:51
      #1  0x00007f96e90c3801 in __GI_abort () at abort.c:79
      #2  0x00007f96e6e12822 in __wt_abort (session=0x5583378de000) at ../src/os_common/os_abort.c:30
      #3  0x00007f96e6cfa49d in __wt_page_only_modify_set (session=0x5583378de000, page=0x5583383c1f00) at ../src/include/btree.i:475
      #4  0x00007f96e6cfa664 in __wt_page_modify_set (session=0x5583378de000, page=0x5583383c1f00) at ../src/include/btree.i:593
      #5  0x00007f96e6cfb9cd in __wt_delete_page_instantiate (session=0x5583378de000, ref=0x7f96d4071220) at ../src/btree/bt_delete.c:322
      #6  0x00007f96e6d17b18 in __page_read (session=0x5583378de000, ref=0x7f96d4071220, flags=1195) at ../src/btree/bt_read.c:626
      #7  0x00007f96e6d18209 in __wt_page_in_func (session=0x5583378de000, ref=0x7f96d4071220, flags=1195, func=0x7f96e6eb16b0 <__func__.35298> "__tree_walk_internal", line=493) at ../src/btree/bt_read.c:727
      #8  0x00007f96e6d43999 in __wt_page_swap_func (session=0x5583378de000, held=0x0, want=0x7f96d4071220, flags=1195, func=0x7f96e6eb16b0 <__func__.35298> "__tree_walk_internal", line=493) at ../src/include/btree.i:1633
      #9  0x00007f96e6d4466c in __tree_walk_internal (session=0x5583378de000, refp=0x7ffd65fc4d50, walkcntp=0x0, skip_func=0x0, func_cookie=0x0, flags=139) at ../src/btree/bt_walk.c:492
      #10 0x00007f96e6d4492c in __wt_tree_walk (session=0x5583378de000, refp=0x7ffd65fc4d50, flags=137) at ../src/btree/bt_walk.c:561
      #11 0x00007f96e6dcb391 in __wt_evict_file (session=0x5583378de000, syncop=WT_SYNC_DISCARD) at ../src/evict/evict_file.c:77
      #12 0x00007f96e6d75452 in __wt_conn_dhandle_close (session=0x5583378de000, final=true, mark_dead=false) at ../src/conn/conn_dhandle.c:386
      #13 0x00007f96e6d7650b in __wt_conn_dhandle_discard_single (session=0x5583378de000, final=true, mark_dead=false) at ../src/conn/conn_dhandle.c:715
      #14 0x00007f96e6d768a2 in __wt_conn_dhandle_discard (session=0x5583378de000) at ../src/conn/conn_dhandle.c:778
      #15 0x00007f96e6d7bb4b in __wt_connection_close (conn=0x5583378c3780) at ../src/conn/conn_open.c:101
      #16 0x00007f96e6d6854b in __conn_close (wt_conn=0x5583378c3780, config=0x0) at ../src/conn/conn_api.c:1100
      #17 0x00007f96e7128ca8 in _wrap_Connection_close (self=<optimised out>, args=<optimised out>) at wiredtiger_wrap.c:8784

      In the feature branch prepare_lookaside01 hit this assert after the test completes and connection is closed.

      What is happening:

      • The test has completed and the connection is being closed, which causes dhandles to be discarded and set as WT_DHANDLE_DEAD
      • The processing of discarding the dhandles causes the files to be evicted as part of the WT_SYNC_DISCARD cache operation. The affected file is being walked and it hits a deleted page.
      • The deleted page is read back in the memory, so the page and tree are marked dirty and the contents are marked deleted.
      • When marking the page dirty, we hit the assert that dhandle should not be dead.


          Issue Links



              keith.bostic Keith Bostic
              sulabh.mahajan Sulabh Mahajan
              0 Vote for this issue
              3 Start watching this issue