[LU-15486] FLR: mirroring a non-mirrored file in a directory with default FLR layout fails Created: 26/Jan/22  Updated: 08/Aug/22  Resolved: 08/Aug/22

Status: Resolved
Project: Lustre
Component/s: None
Affects Version/s: Lustre 2.12.8
Fix Version/s: Lustre 2.16.0

Type: Bug Priority: Minor
Reporter: Andreas Dilger Assignee: Zhenyu Xu
Resolution: Fixed Votes: 0
Labels: None

Issue Links:
Related
Severity: 3
Rank (Obsolete): 9223372036854775807
Epic Link: FLR tech debt review

 Description   

If a file does not have a mirror in a directory with a default FLR mirror, then running "lfs mirror extend" on the file fails with "cannot create volatile file: Invalid argument".

A non-striped file can be created in a directory with a default FLR layout, for example, if a new file is created with "O_APPEND" (LU-9341) and uses the mdt.*.append_* parameters to create the file layout, or if a non-mirrored file is renamed into a directory with a default FLR layout.

# mkdir $DIR/$tdir
# lfs setstripe -N -c 1 -i 0 -N -c 1 -i 1 $DIR/$tdir
# echo $tfile >> $DIR/$tdir/$tfile.append
# lfs getstripe -N $DIR/$tdir/$tfile.append

# lfs mirror extend -N -c 1 -i 2 $DIR/$tdir/$tfile.append
lfs mirror extend: /mnt/testfs/d2/f2.append: cannot create volatile file: Invalid argument

It appears that the problem might relate to the "lfs mirror extend" volatile file inheriting the FLR layout from the parent directory but then confusing the logic later and causing the extend operation to fail. Hard-linking the file into a non-FLR parent directory allows the "lfs mirror extend" to create a mirror on the file:

# mkdir $DIR/$tdir.tmp
# lfs setstripe -d $DIR/$tdir.tmp
# ln $DIR/$tdir/$tfile-append $DIR/$tdir.tmp/$tfile.tmp
# lfs mirror extend -N -c 1 -i 2 $DIR/$tdir.tmp/$tfile.tmp
# rm $DIR/$tdir.tmp/$tfile.tmp
# lfs getstripe -N $DIR/$tdir/$tfile.append
2


 Comments   
Comment by Gerrit Updater [ 14/Feb/22 ]

"Bobi Jam <bobijam@hotmail.com>" uploaded a new patch: https://review.whamcloud.com/46517
Subject: LU-15486 lod: mirroring a plain file in mirrored-layout dir
Project: fs/lustre-release
Branch: master
Current Patch Set: 1
Commit: ed7983ac1be07239105112c60e0544e71f325841

Comment by Gerrit Updater [ 08/Aug/22 ]

"Oleg Drokin <green@whamcloud.com>" merged in patch https://review.whamcloud.com/46517/
Subject: LU-15486 lod: mirroring a plain file in mirrored-layout dir
Project: fs/lustre-release
Branch: master
Current Patch Set:
Commit: 8005a374cac2ba726a88cec3c1bb331fc96153a1

Comment by Peter Jones [ 08/Aug/22 ]

Landed for 2.16

Generated at Sat Feb 10 03:18:43 UTC 2024 using Jira 9.4.14#940014-sha1:734e6822bbf0d45eff9af51f82432957f73aa32c.