[LU-11918] Allow setting default file layout on root directory at mkfs time Created: 02/Feb/19  Updated: 05/Jan/24

Status: Open
Project: Lustre
Component/s: None
Affects Version/s: Lustre 2.12.0, Lustre 2.13.0
Fix Version/s: Lustre 2.16.0

Type: Improvement Priority: Major
Reporter: Andreas Dilger Assignee: WC Triage
Resolution: Unresolved Votes: 0
Labels: medium

Issue Links:
Blocker
is blocked by LU-11656 "lfs getstripe" on directory does not... Resolved
Related
is related to LU-10465 increase default stripe size to 4MB Resolved
is related to LU-12390 allow custom filesystem layout for tests Resolved
is related to LU-9324 sanity-pfl test 10 needs to reset the... Resolved
is related to LU-7723 few tests in sanity.sh fail because o... Open
is related to LU-8154 Auster - move setstripe options to co... Resolved
is related to LU-16904 initial test script to run sanity.sh ... In Progress
is related to LU-13058 Intermediate component removal (PFL/SEL) Open
is related to LU-14274 enhance racer/file_create.sh to set s... Resolved
Rank (Obsolete): 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.



 Comments   
Comment by Andreas Dilger [ 08/Jul/19 ]

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.

Comment by James Nunez (Inactive) [ 31/Jul/19 ]

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

Comment by Andreas Dilger [ 14/Jul/21 ]

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").

Comment by Andreas Dilger [ 14/Jul/21 ]

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.

Comment by Andreas Dilger [ 05/Jan/24 ]

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"

Generated at Sat Feb 10 02:48:04 UTC 2024 using Jira 9.4.14#940014-sha1:734e6822bbf0d45eff9af51f82432957f73aa32c.