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

LSM checkpoint handle acquisition optimization

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • WT2.9.0
    • Affects Version/s: WT2.8.0
    • Component/s: None
    • None

      While debugging WT-2330, keith.bostic found the following bug in LSM:

      With this change:

      diff --git a/src/block/block_open.c b/src/block/block_open.c
      index f4da5ca..eb42ddb 100644
      --- a/src/block/block_open.c
      +++ b/src/block/block_open.c
      @@ -209,7 +209,7 @@ __wt_block_open(WT_SESSION_IMPL *session,
              block->preload_available = true;
       
              /* Open the underlying file handle. */
      -       WT_ERR(__wt_open(session, filename, WT_FILE_TYPE_DATA, 0, &block->fh));
      +       WT_ERR(__wt_open(session, filename, WT_FILE_TYPE_DATA, readonly ? WT_OPEN_READONLY : 0, &block->fh));
       
              /* Set the file's size. */
              WT_ERR(__wt_filesize(session, block->fh, &block->size));
      

      And this Python script:

      #!/usr/bin/env python
      
      import os
      import wiredtiger, wttest
      from suite_subprocess import suite_subprocess
      from helper import simple_populate
      
      class f(wttest.WiredTigerTestCase, suite_subprocess):
          def test_dump(self):
              dir='XXX'
              uri = 'lsm:xxx'
              simple_populate(self, uri, 'key_format=S', 100)
      
              os.mkdir(dir)
              self.runWt(['dump', uri], outfilename='dump.out')
      
              self.runWt(['-h', dir, 'load', '-f', 'dump.out'])
              self.runWt(['-h', dir, 'load', '-f', 'dump.out'])
      
      if __name__ == '__main__':
          wttest.run()
      

      Running the Python script errors with:

      [1459214811:933618][33847:0x803006400], file:xxx-000002.lsm,
      WT_SESSION.checkpoint: xxx-000002.lsm: handle-truncate: ftruncate: Invalid argument
      

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

              Created:
              Updated:
              Resolved: