Details
-
Bug
-
Resolution: Fixed
-
Minor
-
Lustre 2.12.3
-
3
-
9223372036854775807
Description
I have a small tool (attached) that duplicates Lustre files using raw xattrs (i.e standard mknod + setxattr).
With this method, PFL components that were initialized on the original file seem to always be created on OST index 0 on the duplicated file.
For example, let's say that we have 4 OSTs and we create a PFL file comp_file with 2 components and explicit OST offsets 2 and 3.
$ lfs setstripe -E 1M -c 2 -i 2 -E -1 -c -1 -i 3 comp_file
$ lfs getstripe comp_file
comp_file
lcm_layout_gen: 2
lcm_mirror_count: 1
lcm_entry_count: 2
lcme_id: 1
lcme_mirror_id: 0
lcme_flags: init
lcme_extent.e_start: 0
lcme_extent.e_end: 1048576
lmm_stripe_count: 2
lmm_stripe_size: 65536
lmm_pattern: raid0
lmm_layout_gen: 0
lmm_stripe_offset: 2
lmm_objects:
- 0: { l_ost_idx: 2, l_fid: [0x100020000:0x7c:0x0] }
- 1: { l_ost_idx: 3, l_fid: [0x100030000:0x53:0x0] }
lcme_id: 2
lcme_mirror_id: 0
lcme_flags: 0
lcme_extent.e_start: 1048576
lcme_extent.e_end: EOF
lmm_stripe_count: -1
lmm_stripe_size: 65536
lmm_pattern: raid0
lmm_layout_gen: 0
lmm_stripe_offset: 3
Calling the small tool to duplicate this layout into a new file comp_file_dup sets the first lmm_stripe_offset to 0.
$ ./simple_lustre_dup comp_file comp_file_dup
$ lfs getstripe comp_file_dup
comp_file_dup
lcm_layout_gen: 2
lcm_mirror_count: 1
lcm_entry_count: 2
lcme_id: 1
lcme_mirror_id: 0
lcme_flags: init
lcme_extent.e_start: 0
lcme_extent.e_end: 1048576
lmm_stripe_count: 2
lmm_stripe_size: 65536
lmm_pattern: raid0
lmm_layout_gen: 0
lmm_stripe_offset: 0
lmm_objects:
- 0: { l_ost_idx: 0, l_fid: [0x100000000:0x357:0x0] }
- 1: { l_ost_idx: 1, l_fid: [0x100010000:0x367:0x0] }
lcme_id: 2
lcme_mirror_id: 0
lcme_flags: 0
lcme_extent.e_start: 1048576
lcme_extent.e_end: EOF
lmm_stripe_count: -1
lmm_stripe_size: 65536
lmm_pattern: raid0
lmm_layout_gen: 0
lmm_stripe_offset: 3
As was explained to me by Andreas, it makes sense to ignore the offset on duplication but -1 would be a better default value, letting the MDS choose the most appropriate OST.
According to Andreas this might be related to
LU-2809 llite: Do not return layout_gen for getxattr
LU-9484 llite: eat -EEXIST on setting trusted.lov
Attachments
Issue Links
- is related to
-
LU-16500 "lfs migrate <file>" preserves specific layout too much
-
- Resolved
-