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

Fast-path fs_directory_list of a single file.

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

      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.

            keith.bostic@mongodb.com Keith Bostic (Inactive)
            sue.loverso@mongodb.com Susan LoVerso
            0 Vote for this issue
            5 Start watching this issue