Whamcloud - gitweb
LU-16322: build: Add client build support for openEuler
[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 EXAMPLE
55 .TP
56 Register 2 changelog consumers on the MDT0000
57 .br
58 [root@mds]: lctl --device lustrefs-MDT0000 changelog_register
59 .br
60 lustrefs-MDT0000: Registered changelog userid 'cl1'
61 .br
62 [root@mds]: lctl --device lustrefs-MDT0000 changelog_register
63 .br
64 lustrefs-MDT0000: Registered changelog userid 'cl2'
65 .TP
66 Set changelog mask to generate changelogs for file creations
67 .br
68 [root@mds]: lctl set_param mdd.lustrefs-MDT0000.changelog_mask=CREAT
69 .br
70 mdd.lustrefs-MDT0000.changelog_mask=CREAT
71 .TP
72 Generate changelogs by creating some files on the fs
73 .br
74 [root@client]: touch /mnt/lustrefs/test{1..101}
75 .TP
76 Read changelog from number 0 to 99 on MDT0000
77 .br
78 [root@client]: lfs changelog lustrefs-MDT0000 0 99
79 .nf
80 0 01CREAT 11:03:54.129724442 2022.11.22 ...  p=[0x200000007:0x1:0x0] test1
81  ....
82 99 01CREAT 11:03:54.129724465 2022.11.22 ...  p=[0x200000007:0x1:0x0] test100
83 .fi
84 .TP
85 Indicate to MDT0000 that the changelogs lower than 100 are not needed for cl1
86 .br
87 [root@client]: lfs changelog_clear  lustrefs-MDT0000 cl1 99
88 .br
89 .TP
90 Indicate to MDT0000 that the changelogs lower than 100 are not needed for cl2
91 .br
92 [root@client]: lfs changelog_clear  lustrefs-MDT0000 cl2 99
93 .br
94 .TP
95 The changelogs from 0 to 99 are cleared by the MDT:
96 [root@client]: lfs changelog lustrefs-MDT0000 0
97 .br
98 100 01CREAT 11:03:54.129724492 2022.11.22  ...  p=[0x200000007:0x1:0x0] test101
99 .SH SEE ALSO
100 .BR lfs (1),
101 .BR llapi_changelog_clear (3)
102 .BR llapi_changelog_recv (3)
103 .BR llapi_changelog_start (3)
104 .BR lctl-changelog_register (8)
105 .BR lctl-changelog_deregister (8)