Description of problem: At the moment, gluster stores the default retention period in the retention_state data model.This model contains several informations about the WORM state and defines it. The informations inside that model are used in several places in the WORM Xlator. After setting all datas, this model will be serialized and saved as xattr named "trusted.reten_state". If someone increases the atime of a WORM/Retained file, there will be a new atime and therefore a new retention. But the value of the retention_period which was initially stored in the xattr named "trusted.reten_state", will not be updated. Version-Release number of selected component (if applicable): 3.12.5 How reproducible: You need access to a gluster volume via FUSE or something else and worm-file-level must be switched on. Steps to Reproduce: [root@fs-debug1 gv0]# date && echo test >> test.txt Mon Mar 12 10:17:51 GMT 2018 [root@fs-debug1 gv0]# date && chmod 444 test.txt Mon Mar 12 10:18:06 GMT 2018 [root@fs-debug1 gv0]# date && getfattr -d -m "trusted.reten_state" /gluster/brick1/glusterbrick/test.txt Mon Mar 12 10:18:32 GMT 2018 getfattr: Removing leading '/' from absolute path names # file: gluster/brick1/glusterbrick/test.txt trusted.reten_state="11/120/180" [root@fs-debug1 gv0]# date && touch -a -t 201803121125 test.txt Mon Mar 12 10:18:46 GMT 2018 [root@fs-debug1 gv0]# stat test.txt File: ‘test.txt’ Size: 5 Blocks: 1 IO Block: 131072 regular file Device: 26h/38d Inode: 9305711674865251163 Links: 1 Access: (0444/-r--r--r--) Uid: ( 0/ root) Gid: ( 0/ root) Access: 2018-03-12 11:25:00.000000000 +0000 Modify: 2018-03-12 10:17:51.574280941 +0000 Change: 2018-03-12 10:18:46.721771941 +0000 Birth: - [root@fs-debug1 gv0]# date && getfattr -d -m "trusted.reten_state" /gluster/brick1/glusterbrick/test.txt Mon Mar 12 10:19:01 GMT 2018 getfattr: Removing leading '/' from absolute path names # file: gluster/brick1/glusterbrick/test.txt trusted.reten_state="11/120/180" Actual results: The value of the retention_period (120) is not updated in the xattr after increasing the atime of a WORM/Retained file manually. Expected results: This value should be updated in the xattr Additional info:
As far as I can tell the purpose of storing ret_period is to restore the file to the original state it had before transitioning into WORM/Retention. If ret_period is not updated correctly then this original state can't ever be restored correctly, which calls into question the whole purpose of storing this value.
Release 3.12 has been EOLd and this bug was still found to be in the NEW state, hence moving the version to mainline, to triage the same and take appropriate actions.
REVIEW: https://review.gluster.org/23184 (WIP: xlator update on changing access time of a WORM-Aretained file) posted (#1) for review on master by Vishal Pandey
REVIEW: https://review.gluster.org/23184 (Worm: xattr update on changing access time of a WORM-Retained file) merged (#12) on master by Amar Tumballi