From 49a66627ea6fd91d0fe475a031b5ba9fa8e6f7bd Mon Sep 17 00:00:00 2001 From: Andreas Dilger Date: Sat, 14 Dec 2024 13:06:56 -0700 Subject: [PATCH] LU-13055 doc: add changelog_register name/mask Add a description of the changelog_register --name and --mask options. Signed-off-by: Andreas Dilger Change-Id: I3243a4c5efd28daec139b884112e60187ecd03ee Reviewed-on: https://review.whamcloud.com/c/doc/manual/+/57435 Tested-by: jenkins --- LustreMonitoring.xml | 84 ++++++++++++++++++++++++++++++++++------------------ 1 file changed, 55 insertions(+), 29 deletions(-) diff --git a/LustreMonitoring.xml b/LustreMonitoring.xml index 8a45c5d..dd24526 100644 --- a/LustreMonitoring.xml +++ b/LustreMonitoring.xml @@ -285,13 +285,28 @@ Working with Changelogs Because changelog records take up space on the MDT, the system administration must register changelog users. As soon as a changelog - user is registered, the Changelogs feature is enabled. The registrants - specify which records they are "done with", and the system - purges up to the greatest common record. - To register a new changelog user, run: + user is registered, the Changelogs feature is enabled. Users specify + which records they have finished processing, + and the system purges up to the greatest common processed record. + + To register a new changelog user, for each MDT run: -mds# lctl --device fsname-MDTnumber changelog_register +mds# lctl --device FSNAME-MDTxxxx changelog_register \ + --user USERNAME --mask RECORD_TYPES + The USERNAME is a descriptive ASCII + string up to 16 characters that allows identifying registered + changelog users more easily, and is combined with a unique identifier. + + The RECORD_TYPES is a comma-separated + list of the above record types that this user is interested in. The + per-user mask is combined with other user masks to form the global + changelog_mask of all record types that are saved. + By registering a per-user mask instead of modifying the global + changelog_mask the changelog will record only the + minimal set of record types that are needed by the currently-registered + users. + Changelog entries are not purged beyond a registered user's set point (see lfs changelog_clear). @@ -340,14 +355,23 @@ client# lfs changelog_clear mdt_name use
- <literal>lctl changelog_deregister</literal> + <literal>lctl changelog_deregister [<replaceable>USERID</replaceable>|--user <replaceable>USERNAME</replaceable>]</literal> To deregister (unregister) a changelog user, run: -mds# lctl --device mdt_device changelog_deregister userid +mds# lctl --device mdt_device changelog_deregister USERID - changelog_deregister cl1 effectively does a - lfs changelog_clear cl1 0 as it deregisters. + If USERID is specified, this matches + only the exact user ID string that was returned when + changelog_register was called. + If USERNAME is specified, then it will match + a changelog username beginning with USERNAME, + to simplify automatic deregistering a service user registered by name + from a script, rather than having to know the exact username. + + Running changelog_deregister cl1 effectively + does a lfs changelog_clear cl1 0 as it deregisters. +
@@ -356,11 +380,12 @@ mds# lctl --device mdt_device changelog_deregister
Registering a Changelog User - To register a new changelog user for a device + To register a new "monitor" user for a device (lustre-MDT0000): -mds# lctl --device lustre-MDT0000 changelog_register -lustre-MDT0000: Registered changelog userid 'cl1' +mds# lctl --device lustre-MDT0000 changelog_register --user monitor \ + --mask UNLNK,CLOSE +lustre-MDT0000: Registered changelog userid 'monitor-cl1'
@@ -396,10 +421,10 @@ u=500:500 nid=10.128.11.159@tcp p=[0x200000402:0x1:0x0] chloe.jpg
Clearing Changelog Records - To notify a device that a specific user (cl1) + To notify a device that a specific user (monitor-cl1) no longer needs records (up to and including 3): -# lfs changelog_clear lustre-MDT0000 cl1 3 +# lfs changelog_clear lustre-MDT0000 monitor-cl1 3 To confirm that the changelog_clear operation was successful, run lfs changelog; only records after @@ -412,14 +437,14 @@ u=500:500 nid=10.128.11.159@tcp p=[0x200000007:0x1:0x0] pics
Deregistering a Changelog User - To deregister a changelog user (cl1) for a - specific device (lustre-MDT0000): + To deregister a changelog user (monitor-cl1) + for a specific device (lustre-MDT0000): -mds# lctl --device lustre-MDT0000 changelog_deregister cl1 -lustre-MDT0000: Deregistered changelog user 'cl1' +mds# lctl --device lustre-MDT0000 changelog_deregister --user monitor +lustre-MDT0000: Deregistered changelog user 'monitor-cl1' The deregistration operation clears all changelog records for the - specified user (cl1). + specified user (monitor-cl1). client# lfs changelog lustre-MDT0000 5 00MARK 15:56:39.603643887 2018.01.09 0x0 t=[0x20001:0x0:0x0] ef=0xf \ @@ -436,10 +461,10 @@ u=500:500 nid=0@<0:0> p=[0:0x50:0xb] mdd_obd-lustre-MDT0000-0 changelog users for a specific device (lustre-MDT0000): -mds# lctl get_param mdd.lustre-MDT0000.changelog_users +mds# lctl get_param mdd.lustre-MDT0000.changelog_users mdd.lustre-MDT0000.changelog_users=current index: 8 ID index (idle seconds) -cl2 8 (180) +audit-cl2 8 (180)
@@ -447,11 +472,8 @@ cl2 8 (180) To show the current changelog mask on a specific device (lustre-MDT0000): -mds# lctl get_param mdd.lustre-MDT0000.changelog_mask - -mdd.lustre-MDT0000.changelog_mask= -MARK CREAT MKDIR HLINK SLINK MKNOD UNLNK RMDIR RENME RNMTO CLOSE LYOUT \ -TRUNC SATTR XATTR HSM MTIME CTIME MIGRT +mds# lctl get_param mdd.lustre-MDT0000.changelog_mask +mdd.lustre-MDT0000.changelog_mask=MARK UNLNK CLOSE
@@ -466,14 +488,18 @@ $ mkdir /mnt/lustre/mydir/foo $ cp /etc/hosts /mnt/lustre/mydir/foo/file $ ln /mnt/lustre/mydir/foo/file /mnt/lustre/mydir/myhardlink - Only item types that are in the mask show up in the - changelog. + Note that setting changelog_mask + explicitly is deprecated and using the --mask + argument when registering a new user is preferred. + + + Only item types that are in the mask appear in the changelog. + # lfs changelog lustre-MDT0000 9 03HLINK 16:06:35.291636498 2018.01.09 0x0 t=[0x200000402:0x4:0x0] ef=0xf \ u=500:500 nid=10.128.11.159@tcp p=[0x200000007:0x3:0x0] myhardlink -
-- 1.8.3.1