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

dropping checkpoints doesn't close open handles

    • Type: Icon: Task Task
    • Resolution: Done
    • WT1.3
    • Affects Version/s: None
    • Component/s: None

      Michael, I think there's a bug in dropping checkpoints.

      Here's a simple test script:

      import wiredtiger, wttest
      from helper import simplePopulate
       
      class test_xxx(wttest.WiredTigerTestCase):
          def test_xxx(self):
              uri='file:xxx'
      
              # create a small file 
              simplePopulate(self, uri, 'key_format=S', 100)
      
              # checkpoint it
              self.session.checkpoint("name=ckpt1")
      
              # open the checkpoint
              cursor = self.session.open_cursor(uri, None, "checkpoint=ckpt1")
              cursor.close()
      
              # drop the checkpoint
              self.session.checkpoint("name=final,drop=(from=all)") 
      
              # open it again
              # this should fail, we dropped the checkpoint
              cursor = self.session.open_cursor(uri, None, "checkpoint=ckpt1")
              cursor.close()
       
      if __name__ == '__main__':
          wttest.run()
      

      Looking at the files themselves, I see:

      pixiebob:build_posix {2106} find WT_TEST
      WT_TEST
      WT_TEST/results.txt
      WT_TEST/test_xxx.1
      WT_TEST/test_xxx.1/stdout.txt
      WT_TEST/test_xxx.1/stderr.txt
      WT_TEST/test_xxx.1/WiredTiger
      WT_TEST/test_xxx.1/WiredTiger.wt
      WT_TEST/test_xxx.1/WiredTiger.turtle
      WT_TEST/test_xxx.1/xxx
      pixiebob:build_posix {2107} wt -h WT_TEST/test_xxx.1 list -cv
      file:WiredTiger.wt
      	 final: Wed Jul 25 16:19:14 2012 (1 KB)
      allocation_size=512B,block_compressor=,checkpoint=(final=(addr="018481e4540b58be8581e44d6efef38681e4427356ad808080cfc0c5c087",order=1,time=1343233154,size=1536)),checksum=true,collator=,columns=(),huffman_key=,huffman_value=,internal_item_max=0,internal_key_truncate=true,internal_page_max=2KB,key_format=S,key_gap=10,leaf_item_max=0,leaf_page_max=1MB,prefix_compression=true,split_pct=75,type=btree,value_format=S,version=(major=1,minor=0)
      file:xxx
      	 final: Wed Jul 25 16:19:14 2012 (5 KB)
      allocation_size=512B,block_compressor=,checkpoint=(final=(addr="018a81e486b6c4a28b81e4ee64f7788c81e42c1e3725808080dbc0d3c086",order=1,time=1343233154,size=5120)),checksum=true,collator=,columns=(),huffman_key=,huffman_value=,internal_item_max=0,internal_key_truncate=true,internal_page_max=2KB,key_format=S,key_gap=10,leaf_item_max=0,leaf_page_max=1MB,prefix_compression=true,split_pct=75,type=btree,value_format=S,version=(major=1,minor=0)
      pixiebob:build_posix {2108} 
      

      And stepping through the test with gdb, it looks to me like __wt_session_get_btree() is finding an open Btree handle for the checkpoint, which seems like it's a bug, that is, dropping the checkpoint should cause future opens of the checkpoint to fail, shouldn't it?

            Assignee:
            michael.cahill@mongodb.com Michael Cahill (Inactive)
            Reporter:
            keith.bostic@mongodb.com Keith Bostic (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: