[LU-14508] lfs mirror operations do not preserve timestamps Created: 10/Mar/21  Updated: 13/Feb/23  Resolved: 22/Jul/21

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

Type: Bug Priority: Minor
Reporter: John Hammond Assignee: Zhenyu Xu
Resolution: Fixed Votes: 0
Labels: bjhpflr

Issue Links:
Duplicate
duplicates LU-15557 creating/breaking mirror should not c... Resolved
Related
is related to LU-14526 SoM xattr not updated after mirror split Resolved
Severity: 3
Rank (Obsolete): 9223372036854775807

 Description   

lfs mirror extend -N sometimes causes the file atime to go backwards:

# echo XXX > f0; stat f0; sleep 60; cat f0; stat f0; sleep 60; date; lfs mirror extend -N -p ddn_hdd f0; stat f0
  File: ‘f0’
  Size: 4         	Blocks: 1          IO Block: 4194304 regular file
Device: 2c54f966h/743766374d	Inode: 144115205289279491  Links: 1
Access: (0644/-rw-r--r--)  Uid: (    0/    root)   Gid: (    0/    root)
Access: 2021-03-10 10:17:48.000000000 -0600
Modify: 2021-03-10 10:17:48.000000000 -0600
Change: 2021-03-10 10:17:48.000000000 -0600
 Birth: -
XXX
  File: ‘f0’
  Size: 4         	Blocks: 8          IO Block: 4194304 regular file
Device: 2c54f966h/743766374d	Inode: 144115205289279491  Links: 1
Access: (0644/-rw-r--r--)  Uid: (    0/    root)   Gid: (    0/    root)
Access: 2021-03-10 10:18:48.000000000 -0600
Modify: 2021-03-10 10:17:48.000000000 -0600
Change: 2021-03-10 10:17:48.000000000 -0600
 Birth: -
Wed Mar 10 10:19:48 CST 2021
  File: ‘f0’
  Size: 4         	Blocks: 8          IO Block: 4194304 regular file
Device: 2c54f966h/743766374d	Inode: 144115205289279491  Links: 1
Access: (0644/-rw-r--r--)  Uid: (    0/    root)   Gid: (    0/    root)
Access: 2021-03-10 10:17:48.000000000 -0600
Modify: 2021-03-10 10:17:48.000000000 -0600
Change: 2021-03-10 10:17:48.000000000 -0600
 Birth: -


 Comments   
Comment by Andreas Dilger [ 10/Mar/21 ]

This could happen if the most recent atime was stored on the OST objects from patch https://review.whamcloud.com/38024 "LU-13383 ofd: lazy atime update", but is not propagated to the new OST mirror and the old mirror is removed? It shouldn't happen just from adding a mirror, AFAIK, unless the "stat" is only accessing the new mirror copy's OST objects and not the old mirror's objects. Another possibility is that the "cat" step is causing LSOM to store the size/blocks on the MDT, and then the client is no longer fetching attributes from the OST(s) at all, but that would require a new client with statx() support (maybe RHEL8.3/Ubuntu20.04).

Comment by Gerrit Updater [ 11/Mar/21 ]

John L. Hammond (jhammond@whamcloud.com) uploaded a new patch: https://review.whamcloud.com/42009
Subject: LU-14508 lfs: make mirror operations preserve timesstamps
Project: fs/lustre-release
Branch: master
Current Patch Set: 1
Commit: b6968a22b0e5271085fc8f63aec92599e259b249

Comment by John Hammond [ 12/Mar/21 ]

bobijam could you take over on this one too? I created a patch that doesn't quite work and seems to have some ldlm issues. But perhaps you can fix it or at least reuse the tests.

Comment by Gerrit Updater [ 22/Jul/21 ]

Oleg Drokin (green@whamcloud.com) merged in patch https://review.whamcloud.com/42009/
Subject: LU-14508 lfs: make mirror operations preserve timestamps
Project: fs/lustre-release
Branch: master
Current Patch Set:
Commit: 9f672d8a71d8f77d2e807f1d4df926239ade8ebd

Comment by Peter Jones [ 22/Jul/21 ]

Landed for 2.15

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