Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-64752

Does WT metadata change when closing a readonly WT_CONNECTION?

    • Fully Compatible

      When we started implementing PM-2353, Dan Gottlieb provided this helpful sketch that shows how to import MongoDB collections from a directory full of WT files. It follows these steps:

      1. Call wiredtiger_open on the directory of WT files
      2. Fetch WT table and file metadata and save them in memory
      3. Close the WT_CONNECTION
      4. Select which files to import
      5. Move selected files from temp directory to mongod's dbpath
      6. Call WT_SESSION::create for each selected file, using metadata from step 2

      Dan asked, regarding step 3:

      Closing WT I believe will take a checkpoint. Even though we did no logical writes, it's not obvious to me that the root node offsets we saved as part of the WT metadata sit still. The most conservative thing to do is copy the files at this step before closing WT. Obviously that's less desirable than just moving the files. Moving the files underneath WT while running will almost certainly result WT taking down the whole mongod process.

      Worth clarifying with WT how these files can be safely and optimally transfered to the "real" dbpath. If my hunch is right that moving files after closing is not safe today – my guess is it's easy for WT to add configuration string to `WT_CONNECTION::close` that skips taking a checkpoint or find some equivalent solution.

      Could a WiredTiger expert answer his question?

            Assignee:
            jesse@mongodb.com A. Jesse Jiryu Davis
            Reporter:
            jesse@mongodb.com A. Jesse Jiryu Davis
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: