[LU-15557] creating/breaking mirror should not change file timestamps Created: 15/Feb/22  Updated: 22/Jun/22  Resolved: 22/Jun/22

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

Type: Improvement Priority: Minor
Reporter: Mahmoud Hanafi Assignee: Colin Faber
Resolution: Not a Bug Votes: 0
Labels: None

Issue Links:
Duplicate
is duplicated by LU-14508 lfs mirror operations do not preserve... Resolved
Severity: 3
Rank (Obsolete): 9223372036854775807

 Description   

When a file is mirrored and the mirrored is broken file time stamps should be preserved. Here we see that ctime and mtime change to the mirror creation time.

Initial File:

 # stat testfile
  File: 'testfile'
  Size: 59535     	Blocks: 120        IO Block: 4194304 regular file
Device: 521e79ech/1377729004d	Inode: 342273918398214817  Links: 1
Access: (0644/-rw-r--r--)  Uid: (    0/    root)   Gid: (    0/    root)
Access: 2022-02-14 15:48:45.000000000 -0800
Modify: 2022-02-14 15:48:45.000000000 -0800
Change: 2022-02-14 15:48:45.000000000 -0800

 
Now we mirror

 # date; lfs mirror extend -N S 1M -c 1 -p hdd-pool testfile
Mon Feb 14 15:50:27 PST 2022

State the File and layout

# stat testfile
  File: 'testfile'
  Size: 59535     	Blocks: 120        IO Block: 4194304 regular file
Device: 521e79ech/1377729004d	Inode: 342273918398214817  Links: 1
Access: (0644/-rw-r--r--)  Uid: (    0/    root)   Gid: (    0/    root)
Access: 2022-02-14 15:48:45.000000000 -0800
Modify: 2022-02-14 15:48:45.000000000 -0800
Change: 2022-02-14 15:48:45.000000000 -0800
 Birth: -
pfe25 /nobackupp18/mhanafi # lfs getstripe testfile
testfile
  lcm_layout_gen:    1
  lcm_mirror_count:  2
  lcm_entry_count:   4
    lcme_id:             65537
    lcme_mirror_id:      1
    lcme_flags:          init,prefer
    lcme_extent.e_start: 0
    lcme_extent.e_end:   268435456
      lmm_stripe_count:  1
      lmm_stripe_size:   16777216
      lmm_pattern:       raid0
      lmm_layout_gen:    0
      lmm_stripe_offset: 109
      lmm_pool:          ssd-pool
      lmm_objects:
      - 0: { l_ost_idx: 109, l_fid: [0x90000040a:0x53990:0x0] }

    lcme_id:             65538
    lcme_mirror_id:      1
    lcme_flags:          prefer
    lcme_extent.e_start: 268435456
    lcme_extent.e_end:   5368709120
      lmm_stripe_count:  -1
      lmm_stripe_size:   16777216
      lmm_pattern:       raid0
      lmm_layout_gen:    0
      lmm_stripe_offset: -1
      lmm_pool:          ssd-pool

    lcme_id:             65539
    lcme_mirror_id:      1
    lcme_flags:          0
    lcme_extent.e_start: 5368709120
    lcme_extent.e_end:   EOF
      lmm_stripe_count:  16
      lmm_stripe_size:   16777216
      lmm_pattern:       raid0
      lmm_layout_gen:    0
      lmm_stripe_offset: -1
      lmm_pool:          hdd-pool

    lcme_id:             131073
    lcme_mirror_id:      2
    lcme_flags:          init
    lcme_extent.e_start: 0
    lcme_extent.e_end:   EOF
      lmm_stripe_count:  1
      lmm_stripe_size:   1048576
      lmm_pattern:       raid0
      lmm_layout_gen:    0
      lmm_stripe_offset: 0
      lmm_pool:          hdd-pool
      lmm_objects:
      - 0: { l_ost_idx: 0, l_fid: [0x2c0000409:0x30c3e:0x0] }

Break the mirror and stat the file. File ctime and atime has changed.

date; lfs mirror split -d --mirror-id 1 testfile
Mon Feb 14 15:51:31 PST 2022
 # stat testfile
  File: 'testfile'
  Size: 59535     	Blocks: 120        IO Block: 4194304 regular file
Device: 521e79ech/1377729004d	Inode: 342273918398214817  Links: 1
Access: (0644/-rw-r--r--)  Uid: (    0/    root)   Gid: (    0/    root)
Access: 2022-02-14 15:50:27.000000000 -0800
Modify: 2022-02-14 15:48:45.000000000 -0800
Change: 2022-02-14 15:50:27.000000000 -0800
 Birth: -


 Comments   
Comment by Colin Faber [ 15/Feb/22 ]

Hi,

What version are you running?

-cf

Comment by Mahmoud Hanafi [ 15/Feb/22 ]

lustre server/client 2.12.7

Comment by John Hammond [ 15/Feb/22 ]

Generally mirror split will change the block count and therefore should update the ctime. Do you have some workflow or application that is affected by the ctime update?

Comment by Mahmoud Hanafi [ 16/Feb/22 ]

Some users track file time stamps and expect them not to change. 

Comment by Colin Faber [ 16/Feb/22 ]

Hi mhanafi,

LU-14508 should address this and will be availeble in the 2.15 release.

-cf

Comment by Mahmoud Hanafi [ 21/Feb/22 ]

can we get a back port to 2.12.6_ddn and 2.14?

Comment by Colin Faber [ 22/Feb/22 ]

Hi mhanafi,

We're still discussing this, because the blocks change on disk, ctime should change (according to POSIX standard), this is expected behavior, (if the blocks don't change, this patch will prevent ctime updates).

Because of this we need to discuss how to deliver this with (possibly) a configuration option to turn on and off this behavior.

-cf

Comment by Colin Faber [ 22/Jun/22 ]

Hi mhanafi after some discussion with the developers, this behavior is as designed specifically desirable with the creation of new mirrors.

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