Whamcloud - gitweb
LU-15743 utils: add --xattr option to lfs find
[fs/lustre-release.git] / lustre / doc / lfs-changelog.1
1 .TH lfs-changelog 1 "2022-11-22" Lustre "user utilities"
2 .SH NAME
3 lfs-changelog, lfs-changelog_clear \- client utility to read and clear Lustre changelogs
4 .SH SYNOPSIS
5 .br
6 .B lfs changelog \fR[\fB--follow\fR] \fIMDTNAME\fR [\fISTARTREC \fR[\fIENDREC\fR]]
7 .br
8 .B lfs changelog_clear \fIMDTNAME\fR \fIID\fR \fIENDREC\fR
9 .br
10 .SH DESCRIPTION
11 .TP
12 .B lfs changelog
13 Show the metadata changes on an MDT.  Start point
14 .I STARTREC
15 and end point
16 .I ENDREC
17 points are optional.
18 The
19 .B --follow
20 option will block waiting for new changes.
21 .TP
22 .B lfs changelog_clear
23 Indicate that changelog records previous to
24 .I ENDREC
25 are no longer of
26 interest to a particular consumer
27 .I ID
28 , potentially allowing the MDT to
29 free up disk space. An
30 .I ENDREC
31 of 0 indicates the current last record.
32 .PP
33 Changelog consumers must be registered on the
34 MDT node using:
35 .br
36 .BI "lctl --device " MDT_NAME " changelog_register"
37 .SH RETURN VALUES
38 .PP
39 Return 0 on success or a errno value on failure.
40 .SH ERRORS
41 .TP 15
42 .SM EINVAL
43 One or more invalid arguments are given.
44 .TP
45 .SM ENOENT
46 MDT's changelog char device or changelog user not found.
47 .TP
48 .SM EACCES
49 Not enough permissions to open the changelog char device. By default, the device
50 is only accessible to the root user.
51 .TP
52 .SM EIO
53 Failed to read the changelog record on the MDT.
54 .SH NOTES
55 Certain userspace tools might rely on past Lustre behavior of displaying the
56 shard's parent FID instead of the real parent FID, in changelog records related
57 to striped directories or filesystem objects contained within them; if this
58 behavior is needed for compatibility, please set mdd.*.enable_shard_pfid=1. This
59 tunable might be deprecated in a future Lustre release.
60 .SH EXAMPLE
61 .TP
62 Register 2 changelog consumers on the MDT0000
63 .br
64 [root@mds]: lctl --device lustrefs-MDT0000 changelog_register
65 .br
66 lustrefs-MDT0000: Registered changelog userid 'cl1'
67 .br
68 [root@mds]: lctl --device lustrefs-MDT0000 changelog_register
69 .br
70 lustrefs-MDT0000: Registered changelog userid 'cl2'
71 .TP
72 Set changelog mask to generate changelogs for file creations
73 .br
74 [root@mds]: lctl set_param mdd.lustrefs-MDT0000.changelog_mask=CREAT
75 .br
76 mdd.lustrefs-MDT0000.changelog_mask=CREAT
77 .TP
78 Generate changelogs by creating some files on the fs
79 .br
80 [root@client]: touch /mnt/lustrefs/test{1..101}
81 .TP
82 Read changelog from number 0 to 99 on MDT0000
83 .br
84 [root@client]: lfs changelog lustrefs-MDT0000 0 99
85 .nf
86 0 01CREAT 11:03:54.129724442 2022.11.22 ...  p=[0x200000007:0x1:0x0] test1
87  ....
88 99 01CREAT 11:03:54.129724465 2022.11.22 ...  p=[0x200000007:0x1:0x0] test100
89 .fi
90 .TP
91 Indicate to MDT0000 that the changelogs lower than 100 are not needed for cl1
92 .br
93 [root@client]: lfs changelog_clear  lustrefs-MDT0000 cl1 99
94 .br
95 .TP
96 Indicate to MDT0000 that the changelogs lower than 100 are not needed for cl2
97 .br
98 [root@client]: lfs changelog_clear  lustrefs-MDT0000 cl2 99
99 .br
100 .TP
101 The changelogs from 0 to 99 are cleared by the MDT:
102 [root@client]: lfs changelog lustrefs-MDT0000 0
103 .br
104 100 01CREAT 11:03:54.129724492 2022.11.22  ...  p=[0x200000007:0x1:0x0] test101
105 .SH SEE ALSO
106 .BR lfs (1),
107 .BR llapi_changelog_clear (3)
108 .BR llapi_changelog_recv (3)
109 .BR llapi_changelog_start (3)
110 .BR lctl-changelog_register (8)
111 .BR lctl-changelog_deregister (8)