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

Fast-path fs_directory_list of a single file.

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 3.6.3, 3.7.1, WT3.1.0
    • Component/s: None
    • Labels:
      None
    • Sprint:
      Storage 2017-12-04, Storage 2017-12-18, Storage 2018-01-01

      Description

      We may or may not want to do this because it may complicate the file system interface. But in the critical path of switching log files the code looks for a pre-allocated log file by sending in the prefix name. The fs_directory_list function, which becomes wt_posix_directory_list typically, walks the entire directory given and returns the shortened prefix-matching list of file names. It must walk every entry to provide a complete list of matching names.

      The log_alloc_prealloc function only needs a single file and just uses the first entry returned in the list, discarding all others.

      It would be more efficient to be able to indicate that we only need one such file returned so that the loop calling readdir in the operating system can stop when it finds the first match. Sometimes journal directories can contain a huge number of files and saving part of that walk on every file change should help (or at least not hinder) performance on log file switches.

        Attachments

          Activity

            People

            • Assignee:
              keith.bostic Keith Bostic
              Reporter:
              sue.loverso Susan LoVerso
            • Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: