Uploaded image for project: 'Lustre'
  1. Lustre
  2. LU-14459

DNE3: directory auto split during create

Details

    • Improvement
    • Resolution: Unresolved
    • Major
    • None
    • None
    • 9223372036854775807

    Description

      Directory auto-split should be done when the dir_split_count is hit during file creation to minimize the number of entries that need to be moved, rather than afterward. Otherwise, the entries are being created on a single MDT first, and only being migrated on a later directory access. This is sub-optimal for two reasons:

      • the initial file creation will be limited to a single MDT and not distribute the load across multiple MDTs, so just entry migration will still leave all the inodes on the original MDT
      • the post-creation migration will need to move many more files/entries to the other MDTs than if the files are created on the correct MDT to start with

      Attachments

        Issue Links

          Activity

            [LU-14459] DNE3: directory auto split during create

            Oleg Drokin (green@whamcloud.com) merged in patch https://review.whamcloud.com/43291/
            Subject: LU-14459 mdt: support fixed directory layout
            Project: fs/lustre-release
            Branch: master
            Current Patch Set:
            Commit: 4c2514f4832801374092f3a48c755248af345566

            gerrit Gerrit Updater added a comment - Oleg Drokin (green@whamcloud.com) merged in patch https://review.whamcloud.com/43291/ Subject: LU-14459 mdt: support fixed directory layout Project: fs/lustre-release Branch: master Current Patch Set: Commit: 4c2514f4832801374092f3a48c755248af345566

            Oleg Drokin (green@whamcloud.com) merged in patch https://review.whamcloud.com/43290/
            Subject: LU-14459 mdt: restripe parent may be a stripe
            Project: fs/lustre-release
            Branch: master
            Current Patch Set:
            Commit: a84efc8607ae8057499a8800699f336e821b03d8

            gerrit Gerrit Updater added a comment - Oleg Drokin (green@whamcloud.com) merged in patch https://review.whamcloud.com/43290/ Subject: LU-14459 mdt: restripe parent may be a stripe Project: fs/lustre-release Branch: master Current Patch Set: Commit: a84efc8607ae8057499a8800699f336e821b03d8

            Oleg Drokin (green@whamcloud.com) merged in patch https://review.whamcloud.com/43289/
            Subject: LU-14459 llite: reset pfid after dir migration
            Project: fs/lustre-release
            Branch: master
            Current Patch Set:
            Commit: abbe545a63b304e803ee62443dd65f1feeed15cd

            gerrit Gerrit Updater added a comment - Oleg Drokin (green@whamcloud.com) merged in patch https://review.whamcloud.com/43289/ Subject: LU-14459 llite: reset pfid after dir migration Project: fs/lustre-release Branch: master Current Patch Set: Commit: abbe545a63b304e803ee62443dd65f1feeed15cd

            Oleg Drokin (green@whamcloud.com) merged in patch https://review.whamcloud.com/43684/
            Subject: LU-14459 lmv: change default hash type to crush
            Project: fs/lustre-release
            Branch: master
            Current Patch Set:
            Commit: bb60caa1c6e7c14c201916dc0423442d10c86a27

            gerrit Gerrit Updater added a comment - Oleg Drokin (green@whamcloud.com) merged in patch https://review.whamcloud.com/43684/ Subject: LU-14459 lmv: change default hash type to crush Project: fs/lustre-release Branch: master Current Patch Set: Commit: bb60caa1c6e7c14c201916dc0423442d10c86a27

            Andreas Dilger (adilger@whamcloud.com) uploaded a new patch: https://review.whamcloud.com/43684
            Subject: LU-14459 lmv: change default hash type to crush
            Project: fs/lustre-release
            Branch: master
            Current Patch Set: 1
            Commit: e859f57768b8b7ee2e44924c2b36e39a7f0f323a

            gerrit Gerrit Updater added a comment - Andreas Dilger (adilger@whamcloud.com) uploaded a new patch: https://review.whamcloud.com/43684 Subject: LU-14459 lmv: change default hash type to crush Project: fs/lustre-release Branch: master Current Patch Set: 1 Commit: e859f57768b8b7ee2e44924c2b36e39a7f0f323a

            Lai Siyao (lai.siyao@whamcloud.com) uploaded a new patch: https://review.whamcloud.com/43291
            Subject: LU-14459 mdt: support fixed directory layout
            Project: fs/lustre-release
            Branch: master
            Current Patch Set: 1
            Commit: 0c0995c016c49f21b1dea938cdb71c6ccb7bf658

            gerrit Gerrit Updater added a comment - Lai Siyao (lai.siyao@whamcloud.com) uploaded a new patch: https://review.whamcloud.com/43291 Subject: LU-14459 mdt: support fixed directory layout Project: fs/lustre-release Branch: master Current Patch Set: 1 Commit: 0c0995c016c49f21b1dea938cdb71c6ccb7bf658

            Lai Siyao (lai.siyao@whamcloud.com) uploaded a new patch: https://review.whamcloud.com/43290
            Subject: LU-14459 mdt: restripe parent may be a stripe
            Project: fs/lustre-release
            Branch: master
            Current Patch Set: 1
            Commit: 93711b9e00d28d235c2b10409bf135eb6c6e5944

            gerrit Gerrit Updater added a comment - Lai Siyao (lai.siyao@whamcloud.com) uploaded a new patch: https://review.whamcloud.com/43290 Subject: LU-14459 mdt: restripe parent may be a stripe Project: fs/lustre-release Branch: master Current Patch Set: 1 Commit: 93711b9e00d28d235c2b10409bf135eb6c6e5944

            Lai Siyao (lai.siyao@whamcloud.com) uploaded a new patch: https://review.whamcloud.com/43289
            Subject: LU-14459 llite: init stripe pfid after dir split
            Project: fs/lustre-release
            Branch: master
            Current Patch Set: 1
            Commit: 768bc1b9e93ebc5c3c53612287abd3ca136c622c

            gerrit Gerrit Updater added a comment - Lai Siyao (lai.siyao@whamcloud.com) uploaded a new patch: https://review.whamcloud.com/43289 Subject: LU-14459 llite: init stripe pfid after dir split Project: fs/lustre-release Branch: master Current Patch Set: 1 Commit: 768bc1b9e93ebc5c3c53612287abd3ca136c622c

            Lai Siyao (lai.siyao@whamcloud.com) uploaded a new patch: https://review.whamcloud.com/42064
            Subject: LU-14459 mdt: trigger dir split in create/open
            Project: fs/lustre-release
            Branch: master
            Current Patch Set: 1
            Commit: 0edbcc3ce6de3f2c625c5f3be6805565a81fab51

            gerrit Gerrit Updater added a comment - Lai Siyao (lai.siyao@whamcloud.com) uploaded a new patch: https://review.whamcloud.com/42064 Subject: LU-14459 mdt: trigger dir split in create/open Project: fs/lustre-release Branch: master Current Patch Set: 1 Commit: 0edbcc3ce6de3f2c625c5f3be6805565a81fab51
            laisiyao Lai Siyao added a comment -

            The dirent count is maintained in osd_object.oo_dirent_count, which will be updated in creation/removal.

            The reason why it's not cached in mdt_object is that if the newly created sub file is remote object, its parent is remote, thus the cached dirent count can't be updated.

            mot_auto_split_disabled is from legacy code, it's intended to stop retrying splitting a directory (maybe we should say both splitting and sub files migration) if some error occurred in auto-split, and it failed after several retries. But it's not implemented, and currently it will retry finish splitting directory once server notices an unfinished split.

            laisiyao Lai Siyao added a comment - The dirent count is maintained in osd_object.oo_dirent_count , which will be updated in creation/removal. The reason why it's not cached in mdt_object is that if the newly created sub file is remote object, its parent is remote, thus the cached dirent count can't be updated. mot_auto_split_disabled is from legacy code, it's intended to stop retrying splitting a directory (maybe we should say both splitting and sub files migration) if some error occurred in auto-split, and it failed after several retries. But it's not implemented, and currently it will retry finish splitting directory once server notices an unfinished split.

            Lai, I started looking into this to see if it was easily implemented. I pushed the above patch with some preliminary changes, but it needs more work to be done properly.

            It looks like la_dirent_count is only fetched once at getattr time, but then never updated when directories are added/removed. That needs to be updated during file creation/removal so that the count is at least somewhat accurate as the directory changes. If it simplifies implementation, then la_dirent_count doesn't need to be perfect (e.g. it could be checked only when the name hash % 64 == 0, or whatever), since a growing directory should eventually increase it enough to cause a split, even if the split is a bit late, and for large directories it will eventually hit the stripe count limit and then an accurate count again doesn't matter.

            I wasn't sure exactly where to put the check for mdt_should_auto_split() and mdt_auto_split_add(). First I was thinking in mdt_create(), but that doesn't have la_dirent_count for parent, and adding a call to fetch it on each create seemed like a lot of added overhead. It might make sense to move la_dirent_count into struct mdt_object rather than struct lu_attrs, so that it is kept in memory with the directory instead of having to be fetched from the OSD repeatedly. The la_dirent_count could be fetched once for the mdt_object when it is first loaded, then updated in memory for each create/unlink in the directory (it isn't clear if splitting the directory is useful for hard links or not?).

            Minor note - I see mot_auto_split_disabled in struct mdt_object, but it doesn't look like this is used anywhere and could be removed? Or is there intended to be a way to force a directory to not be split (e.g. attribute set on the directory or layout)?

            adilger Andreas Dilger added a comment - Lai, I started looking into this to see if it was easily implemented. I pushed the above patch with some preliminary changes, but it needs more work to be done properly. It looks like la_dirent_count is only fetched once at getattr time, but then never updated when directories are added/removed. That needs to be updated during file creation/removal so that the count is at least somewhat accurate as the directory changes. If it simplifies implementation, then la_dirent_count doesn't need to be perfect (e.g. it could be checked only when the name hash % 64 == 0, or whatever), since a growing directory should eventually increase it enough to cause a split, even if the split is a bit late, and for large directories it will eventually hit the stripe count limit and then an accurate count again doesn't matter. I wasn't sure exactly where to put the check for mdt_should_auto_split() and mdt_auto_split_add() . First I was thinking in mdt_create() , but that doesn't have la_dirent_count for parent , and adding a call to fetch it on each create seemed like a lot of added overhead. It might make sense to move la_dirent_count into struct mdt_object rather than struct lu_attrs , so that it is kept in memory with the directory instead of having to be fetched from the OSD repeatedly. The la_dirent_count could be fetched once for the mdt_object when it is first loaded, then updated in memory for each create/unlink in the directory (it isn't clear if splitting the directory is useful for hard links or not?). Minor note - I see mot_auto_split_disabled in struct mdt_object , but it doesn't look like this is used anywhere and could be removed? Or is there intended to be a way to force a directory to not be split (e.g. attribute set on the directory or layout)?

            People

              laisiyao Lai Siyao
              adilger Andreas Dilger
              Votes:
              0 Vote for this issue
              Watchers:
              9 Start watching this issue

              Dates

                Created:
                Updated: