[LU-15070] client does not inherit default directory layout if changed Created: 06/Oct/21 Updated: 29/Nov/21 Resolved: 03/Nov/21 |
|
| Status: | Resolved |
| Project: | Lustre |
| Component/s: | None |
| Affects Version/s: | Lustre 2.15.0 |
| Fix Version/s: | Lustre 2.15.0 |
| Type: | Bug | Priority: | Minor |
| Reporter: | Andreas Dilger | Assignee: | Lai Siyao |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Issue Links: |
|
||||||||
| Severity: | 3 | ||||||||
| Rank (Obsolete): | 9223372036854775807 | ||||||||
| Description |
|
If a directory is created and a default directory layout is added to it, the client is not aware that the new default layout exists because of the xattr cache, so the client does not take this into account when creating the directory. This can be seen clearly by setting a round-robin default layout on a directory below the normal 3-level round-robin default root layout, but I suspect it is always true: # mkdir -p /mnt/testfs/rr1/rr2/rr3/sub4
# lfs setdirstripe -D -c 1 -i -1 --max-inherit-rr=3 /mnt/testfs/rr1/rr2/rr3/sub4
# mkdir /mnt/testfs/rr1/rr2/rr3/sub4/d{1..64}
# lfs getdirstripe -m /mnt/testfs/rr1/rr2/rr3/sub4/d{1..64} | sort | uniq -c
64 1
# lctl set_param ldlm.namespaces.*.lru_size=clear
# mkdir /mnt/testfs/rr1/rr2/rr3/sub4/dd{1..64}
# lfs getdirstripe -m /mnt/testfs/rr1/rr2/rr3/sub4/dd{1..64} | sort | uniq -c
16 0
16 1
16 2
16 3
The default layout itself is inherited by the d* and dd* directories, because this is done locally to the MDT, but the decision to do round-robin allocation (and other directory default layouts) is not seen by the client until the directory lock/inode is cancelled and refreshed from the MDT. When "lfs setdirstripe -D" is run on the MDS, it should revoke the MDS_INODELOCK_XATTR lock bit from this directory on all clients, and the client doing this operation itself should include this lock for ELC along with the RPC. |
| Comments |
| Comment by Lai Siyao [ 08/Oct/21 ] |
|
Strange I can't reproduce this on master and exa6 code, even if I copied the script and run. According to the code, when default LMV is set, MDT will revoke XATTR|LOOKUP lock. |
| Comment by Gerrit Updater [ 14/Oct/21 ] |
|
"Lai Siyao <lai.siyao@whamcloud.com>" uploaded a new patch: https://review.whamcloud.com/45236 |
| Comment by Gerrit Updater [ 14/Oct/21 ] |
|
"Lai Siyao <lai.siyao@whamcloud.com>" uploaded a new patch: https://review.whamcloud.com/45237 |
| Comment by Gerrit Updater [ 03/Nov/21 ] |
|
"Oleg Drokin <green@whamcloud.com>" merged in patch https://review.whamcloud.com/45236/ |
| Comment by Gerrit Updater [ 03/Nov/21 ] |
|
"Oleg Drokin <green@whamcloud.com>" merged in patch https://review.whamcloud.com/45237/ |
| Comment by Peter Jones [ 03/Nov/21 ] |
|
Landed for 2.15 |