Whamcloud - gitweb
LU-17920 mgs: handle compound permanent parameters 18/56218/11
authorEtienne AUJAMES <etienne.aujames@cea.fr>
Fri, 30 Aug 2024 17:46:11 +0000 (19:46 +0200)
committerOleg Drokin <green@whamcloud.com>
Tue, 27 May 2025 04:04:15 +0000 (04:04 +0000)
commitf69f27cc354741f797856ffb7c21474ebdab44c8
treedee1aaa942370a8eff2a4528e228cc4e0fce9a48
parent517e76cbefe800251d6d132c7f1d8a0d965d089e
LU-17920 mgs: handle compound permanent parameters

Special parameters like "nrs_tbf_rule" or "pcc" can "append" several
values.

e.g: add several TBF rules for ost_io
  # lctl set_param ost.OSS.ost_io.nrs_policies="tbf jobid"
  # lctl set_param ost.OSS.ost_io.nrs_tbf_rule="start login
    jobid={*login*} rate=5000"
  # lctl set_param ost.OSS.ost_io.nrs_tbf_rule="start rbh
    jobid={*rbh*} rate=100000"

Multiple permanent values are not supported for these parameters since
the it is possible to set a single value today.
The current implementation will only stores the last value and remove
the old records.

This patch allows "pcc", "nrs_tbf_rule" and future "wbc" to store
several values for the same parameter: it appends new llog records
without deleting the old ones.

If the MGS found an existing record matching the new value, it will
not append the new one.

To remove from the configuration only one entry, the patch modifies
the behavior of "lfs set_param -Pd" and "lfs conf_param -d" to match
the parameter name and the value if set. Those commands return
-ENOENT if the entries are not found.

e.g: remove the TBF rule "rbh" from the configuration
  # lctl set_param -Pd ost.OSS.ost_io.nrs_tbf_rule="start rbh
    jobid={*rbh*} rate=100000"

e.g: remove all TBF rules for ost_io service
  # lctl set_param -Pd ost.OSS.ost_io.nrs_tbf_rule

Add regression test conf-sanity 123aj.
Fix conf-sanity 123ag to use "lctl set_param -P -d" with the value set
in configuration (not "ANY").

Fix sanity-sec 27a to use "lctl set_param -P -d" only if the parameter
have been set before.

Test-Parameters: testlist=conf-sanity env=ONLY=123
Test-Parameters: testlist=conf-sanity env=ONLY=123
Test-Parameters: testlist=conf-sanity env=ONLY=123aj,ONLY_REPEAT=20
Test-Parameters: testlist=sanity env=ONLY=400b
Test-Parameters: testlist=sanity env=ONLY=401db,ONLY_REPEAT=20
Signed-off-by: Etienne AUJAMES <eaujames@ddn.com>
Change-Id: I9d3ec3d8d9004218138468739d4f7c5ea8a3eadd
Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/56218
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: Qian Yingjin <qian@ddn.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
lustre/include/lustre_log.h
lustre/include/uapi/linux/lustre/lustre_disk.h
lustre/include/uapi/linux/lustre/lustre_param.h
lustre/mgs/mgs_llog.c
lustre/obdclass/llog.c
lustre/tests/conf-sanity.sh
lustre/tests/sanity-sec.sh
lustre/utils/lustre_cfg.c