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

Allow setting default file layout on root directory at mkfs time

Details

    • Improvement
    • Resolution: Unresolved
    • Critical
    • Lustre 2.17.0
    • Lustre 2.12.0, Lustre 2.13.0
    • 9223372036854775807

    Description

      It is useful to enable newer features like PFL, DoM, and FLR at format time, so that users unfamiliar with Lustre can have a default filesystem configuration that is most useful. In particular, enabling PFL for new filesystems is desirable for new releases, and if the MDT is configured with a large amount of space per inode (using e.g. "--mkfsoptions='-i 65536'" for ldiskfs, or always for ZFS) then a DoM component could be added.

      Some options for implementing this exist:

      • after formatting the MDT, when it is mounted as type ldiskfs use "lfs setstripe" to generate an xattr and write it to the ROOT/ directory using setxattr() instead of ioctl(). Allowing mkfs.lustre to accept an arbitrary layout would be most flexible.
      • have "pre-built" xattrs that are written to the ROOT/ directory at format time (either inside the kernel or from mkfs.lustre. This would likely handle most of the cases, and for expert users that know they want a different default, they can set it after mount.

      I don't think that mounting the MDT as type lustre, and then mounting a local client and using "lfs setstripe" is practical.

      Attachments

        Issue Links

          Activity

            [LU-11918] Allow setting default file layout on root directory at mkfs time

            LU-16904 has added the sanity-compr.sh test script, which is a wrapper that runs sanity and sanityn with a different file layout. The initial patch landed with a 1-stripe PFL layout COMPR_EXTRA_LAYOUT="-E eof -c 1" and fixed a number of issues related to that. Some more work is needed to take this further to allow passing the tests with a more complex PFL layout.

            Once testing with PFL layouts is working, then it should be possible to actually implement the mkfs.lustre support for setting the PFL layout. The test-framework code should pass the default layout from $fs_STRIPEPARAMS to "mkfs.lustre --setstripe"

            adilger Andreas Dilger added a comment - LU-16904 has added the sanity-compr.sh test script, which is a wrapper that runs sanity and sanityn with a different file layout. The initial patch landed with a 1-stripe PFL layout COMPR_EXTRA_LAYOUT="-E eof -c 1" and fixed a number of issues related to that. Some more work is needed to take this further to allow passing the tests with a more complex PFL layout. Once testing with PFL layouts is working, then it should be possible to actually implement the mkfs.lustre support for setting the PFL layout. The test-framework code should pass the default layout from $fs_STRIPEPARAMS to " mkfs.lustre --setstripe "

            One way that mkfs.lustre could set the default layout is directly via setxattr from userspace to the ROOT/ directory while it is mounted locally as type ldiskfs. However, that would not work for ZFS.

            adilger Andreas Dilger added a comment - One way that mkfs.lustre could set the default layout is directly via setxattr from userspace to the ROOT/ directory while it is mounted locally as type ldiskfs. However, that would not work for ZFS.
            adilger Andreas Dilger added a comment - - edited

            According to patch https://review.whamcloud.com/35068 "LU-12390 tests: customise mdsrate tests" it is possible to specify "$fs_STRIPEPARAMS" to set the default filesystem layout in check_and_setup_lustre(). However, there is nothing in the current autotest framework that is using this option.

            What is still needed is to push patches that:

            • verify each test script will pass with "$fs_STRIPEPARAMS" set to a PFL layout (e.g. "-E 2M -c 1 -S 1M -E eof -c 4" or similar)
            • verify that the test script preserves the filesystem default layout to the end. I think sanity.sh will currently clobber the filesystem default layout in some subtests and does not correctly restore it via stack_trap(). Those subtests should be fixed to restore the default.

            Once all test scripts are passing with a default PFL layout, the next step would be to set a default fs_STRIPEPARAMS value in init_test_env() so this is permanently used, and then (separately) have mkfs.lustre (or first MDT mount of a new filesystem creating "ROOT/") set a default PFL layout on the root directory (similar to patch https://review.whamcloud.com/38553 "LU-13417 mdd: set default LMV on ROOT").

            adilger Andreas Dilger added a comment - - edited According to patch https://review.whamcloud.com/35068 " LU-12390 tests: customise mdsrate tests " it is possible to specify " $fs_STRIPEPARAMS " to set the default filesystem layout in check_and_setup_lustre() . However, there is nothing in the current autotest framework that is using this option. What is still needed is to push patches that: verify each test script will pass with "$fs_STRIPEPARAMS" set to a PFL layout (e.g. "-E 2M -c 1 -S 1M -E eof -c 4" or similar) verify that the test script preserves the filesystem default layout to the end. I think sanity.sh will currently clobber the filesystem default layout in some subtests and does not correctly restore it via stack_trap() . Those subtests should be fixed to restore the default. Once all test scripts are passing with a default PFL layout, the next step would be to set a default fs_STRIPEPARAMS value in init_test_env() so this is permanently used, and then (separately) have mkfs.lustre (or first MDT mount of a new filesystem creating " ROOT/ ") set a default PFL layout on the root directory (similar to patch https://review.whamcloud.com/38553 " LU-13417 mdd: set default LMV on ROOT ").
            jamesanunez James Nunez (Inactive) added a comment - - edited

            James Nunez (james.a.nunez@intel.com) uploaded a new patch: https://review.whamcloud.com/26576
            Subject: LU-11918 tests: modify file system layout in testing
            Project: fs/lustre-release
            Branch: master
            Current Patch Set: 1
            Commit: 30fce57cef946ffcf980c62c6a7d732de503dd07

            jamesanunez James Nunez (Inactive) added a comment - - edited James Nunez (james.a.nunez@intel.com) uploaded a new patch: https://review.whamcloud.com/26576 Subject: LU-11918 tests: modify file system layout in testing Project: fs/lustre-release Branch: master Current Patch Set: 1 Commit: 30fce57cef946ffcf980c62c6a7d732de503dd07

            The first step would be to change test-framework.sh to enable PFL layout on the root directory when the filesystem is formatted. This will allow testing and fixing test script breakage where the default layout is assumed to be a plain file before we enable this by default for all filesystems.

            adilger Andreas Dilger added a comment - The first step would be to change test-framework.sh to enable PFL layout on the root directory when the filesystem is formatted. This will allow testing and fixing test script breakage where the default layout is assumed to be a plain file before we enable this by default for all filesystems.

            People

              wc-triage WC Triage
              adilger Andreas Dilger
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated: