Bug 1554286 - Xattr not updated if increasing the retention of a WORM/Retained file
Summary: Xattr not updated if increasing the retention of a WORM/Retained file
Keywords:
Status: CLOSED NEXTRELEASE
Alias: None
Product: GlusterFS
Classification: Community
Component: unclassified
Version: mainline
Hardware: Unspecified
OS: Linux
high
high
Target Milestone: ---
Assignee: Vishal Pandey
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2018-03-12 10:29 UTC by david.spisla
Modified: 2019-10-23 04:05 UTC (History)
1 user (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2019-10-23 04:05:18 UTC
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Gluster.org Gerrit 23184 0 None Merged Worm: xattr update on changing access time of a WORM-Retained file 2019-10-23 04:05:17 UTC

Description david.spisla 2018-03-12 10:29:36 UTC
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:

Comment 1 david.spisla 2018-03-12 12:08:51 UTC
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.

Comment 2 Shyamsundar 2018-10-23 14:55:19 UTC
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.

Comment 3 Worker Ant 2019-08-09 07:06:57 UTC
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

Comment 4 Worker Ant 2019-10-23 04:05:18 UTC
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


Note You need to log in before you can comment on or make changes to this bug.