LFS-CHANGELOG(1)

NAME
lfs-changelog, lfs-changelog_clear - client utility to read and clear Lustre changelogs

SYNOPSIS
lfs changelog [--follow] MDTNAME [STARTREC [ENDREC]]
lfs changelog_clear MDTNAME ID ENDREC

DESCRIPTION

lfs changelog
    Show the metadata changes on an MDT. Start point STARTREC and end point ENDREC points are optional. The --follow option will block waiting for new changes.

lfs changelog_clear
    Indicate that changelog records previous to ENDREC are no longer of interest to a particular consumer ID , potentially allowing the MDT to free up disk space. An ENDREC of 0 indicates the current last record.

Changelog consumers must be registered on the MDT node using:
lctl --device MDT_NAME changelog_register

RETURN VALUES
Return 0 on success or a errno value on failure.

ERRORS

EINVAL
    One or more invalid arguments are given.

ENOENT
    MDT's changelog char device or changelog user not found.

EACCES
    Not enough permissions to open the changelog char device. By default, the device is only accessible to the root user.

EIO Failed to read the changelog record on the MDT.

NOTES
Certain userspace tools might rely on past Lustre behavior of displaying the shard's parent FID instead of the real parent FID, in changelog records related to striped directories or filesystem objects contained within them; if this behavior is needed for compatibility, please set mdd.*.enable_shard_pfid=1. This tunable might be deprecated in a future Lustre release.

EXAMPLES
Register 2 changelog consumers on the MDT0000:
        [root@mds]# lctl --device lustrefs-MDT0000 changelog_register
        lustrefs-MDT0000: Registered changelog userid 'cl1'
        [root@mds]# lctl --device lustrefs-MDT0000 changelog_register
        lustrefs-MDT0000: Registered changelog userid 'cl2'

Set changelog mask to generate changelogs for file creations:
    [root@mds]# lctl set_param mdd.lustrefs-MDT0000.changelog_mask=CREAT
    mdd.lustrefs-MDT0000.changelog_mask=CREAT
Generate changelogs by creating some files on the fs:
    [root@client]# touch /mnt/lustrefs/test{1..101}
Read changelog from number 0 to 99 on MDT0000:
    [root@client]# lfs changelog lustrefs-MDT0000 0 99
    0 01CREAT 11:03:54.129724442 2022.11.22 ... p=[0x200000007:0x1:0x0] test1
     ....
    99 01CREAT 11:03:54.129724465 2022.11.22 ... p=[0x200000007:0x1:0x0] test100

Indicate to MDT0000 that the changelogs lower than 100 are not needed for cl1:
    [root@client]# lfs changelog_clear lustrefs-MDT0000 cl1 99

Indicate to MDT0000 that the changelogs lower than 100 are not needed for cl2:
    [root@client]# lfs changelog_clear lustrefs-MDT0000 cl2 99

The changelogs from 0 to 99 are cleared by the MDT:
    [root@client]# lfs changelog lustrefs-MDT0000 0
    100 01CREAT 11:03:54.129724492 2022.11.22 ... p=[0x200000007:0x1:0x0] test101

AVAILABILITY
lfs changelog and lfs changelog_clear are part of the lustre(7) filesystem package since release 2.0.0

SEE ALSO
lfs(1), llapi_changelog_clear(3), llapi_changelog_recv(3), llapi_changelog_start(3), lctl-changelog_deregister(8), lctl-changelog_register(8)