[lustre-discuss] SATTR in Lustre Changelog

Dilger, Andreas andreas.dilger at intel.com
Thu Mar 24 10:59:03 PDT 2016

On 2016/03/24, 06:59, "lustre-discuss on behalf of LEIBOVICI Thomas"
<lustre-discuss-bounces at lists.lustre.org on behalf of
thomas.leibovici at cea.fr> wrote:

>On 03/23/16 18:02, Qing Zheng wrote:
>> Hi-
>> We are monitoring Lustre 2.7.0 using the Changelog
>> and have a question on SATTR op families
>> We noticed Changelog had defined SATTR, MTIME, CTIME, and ATIME log
>> types.
>> We also kind of figured
>> SATTR with flag 0x10 means CHMOD
>> SATTR with flag 0x20 means CHOWN
>> SATTR with flag 0x40 means CHGRP
>> We'd like to know if it is possible for Lustre to produce SATTR
>> records with mtime/ctime/atime updates?
>> And does Lustre ever produce CTIME or ATIME logs,
>> since so far we don't see those logs in the Changelog even we touch a
>> file manually.
>By default ATIME is not in the changelog mask. To add it:
>echo "+ATIME" > /proc/fs/lustre/mdd/lustre-MDT0000/changelog_mask
>AFAIK, there is a kind of priority and batching between CTIME, MTIME and
>ATIME records.
>For example, if there is already a record for a given fid in the
>changelog, next ATIME/MTIME/CTIME records are not reported - until the
>first MTIME record is cleared.
># create the file
> > touch /mnt/lustre/X
># change file mtime
> > touch /mnt/lustre/X
> > lfs changelog lustre
># mtime change is not reported
>327301 01CREAT 12:45:54.769600767 2016.03.24 0x0
>t=[0x200000402:0xd9fe:0x0] j=touch.0 p=[0x200000007:0x1:0x0] X
> > lfs changelog_clear lustre cl1 0
># change mtime
> > touch /mnt/lustre/X
># change atime
> > cat /mnt/lustre/X
> > lfs changelog lustre
># mtime change is reported, but not atime
>327302 17MTIME 12:47:48.653207857 2016.03.24 0x7
>t=[0x200000402:0xd9fe:0x0] j=touch.0
> > cat /mnt/lustre/X
> > lfs changelog lustre
># atime change is reported
>327303 19ATIME 12:49:23.43229006 2016.03.24 0x1
>t=[0x200000402:0xd9fe:0x0] j=cat.0
>CTIME appears when entry ctime changes but not mtime or atime, and when
>the operation is not covered by a SATTR.
>I couldn't tell exactly when this occurs, but I can see them on a
>production filesystem.

It is worthwhile to note that Lustre does not update atime on the MDS
every time that it is updated by the client, only in memory and in some
cases on the OSTs (where there is no changelog).  It is only written to
disk on the MDS at close time if it is not outdated by at least 60s to
avoid too much overhead.

Cheers, Andreas
Andreas Dilger

Lustre Principal Architect
Intel High Performance Data Division

More information about the lustre-discuss mailing list