-
Type:
Bug
-
Resolution: Unresolved
-
Priority:
Medium
-
None
-
Affects Version/s: None
-
3
-
9223372036854775807
On a file with a PCC-RO copy, lfs mirror delete removes the only OST mirror without an error. The PCC-RO foreign component is the only one left, and the file can no longer be read.
Reproducer, as root on a single-node llmount.sh setup:
mkdir /var/tmp/pcc
LFS_PCC_RW_OK=yes lctl pcc add /mnt/lustre /var/tmp/pcc -p "projid={100} roid=5 pccro=1"
f=/mnt/lustre/f
head -c 1M /dev/urandom > $f; sync
lfs pcc attach -r -i 5 $f # mirror 1 = OST, mirror 2 = foreign (pccro)
lfs mirror delete --mirror-id 1 $f # returns 0
cat $f
Result with 2.17.60_127 modules and 2.17.60_134 lfs (not run on a newer master):
cat: /mnt/lustre/f: No data available
- lfs mirror split -d --mirror-id 1 does the same.
- The layout keeps one component, mirror 2, lhm_type 0x3 (pccro), and lcm_flags loses pccro.
- lfs pcc state shows type none. The size stays 1 MiB. lfs pcc detach does not help.
- The cache file in /var/tmp/pcc still holds the data, but Lustre does not read it.
- Without the delete, the file reads back correctly before and after the detach.
From reading the code (834440df45): mdd_split_ea() sets data_remains for any remaining component that is not LCME_FL_PARITY, so it takes the foreign one as data. The PCC-RO component is not stale, so the stale check does not stop it either. The MDS should probably not count a PCC-RO component as data here. An HSM component may need a different answer: LU-13637 proposes lfs mirror delete as the way to release a file.
Found while testing llapi_mirror_split() (LU-21151).