Uploaded image for project: 'Lustre'
  1. Lustre
  2. LU-20377

mgs: llog_catlist omits the <fsname>-sptlrpc and params config logs

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Minor Minor
    • None
    • Lustre 2.17.0
    • None
    • 3
    • 9223372036854775807

      Currently lctl --device MGS llog_catlist does not enumerate either the filesystem-specific sptlrpc llog file, nor the global params file in it's list, for example on a small test system:

      [root@server1 ~]# lctl llog_catlist                                      
      config_log: lustre-OST0001
      config_log: lustre-MDT0000                                               
      config_log: lustre-OST0005                                               
      config_log: lustre-OST0004                                               
      config_log: nodemap-client                                               
      config_log: lustre-OST0002                                               
      config_log: lustre-client
      config_log: lustre-OST0000                                               
      config_log: ost-client
      config_log: lustre-MDT0001                                               
      config_log: lustre-OST0003

      I believe this is unintentional, and an oversight. Not, only does it make these files slightly less discoverable to an operator from a diagnostic point of view, it also means that the <fsname>-sptlrpc file is not cleared during a --writeconf which I think is incorrect:

      # Before writeconf - filesystem has some sptlrpc settings history configured
      [root@server1 ~]# lctl --device MGS llog_print lustre-sptlrpc | tee /tmp/before-sptlrpc.txt
      - { index: 103, event: security, device: lustre, parameter: srpc.flavor.lo= }
      - { index: 198, event: security, device: lustre, parameter: srpc.flavor.tcp101= }
      - { index: 201, event: security, device: lustre, parameter: srpc.flavor.tcp102= }
      - { index: 204, event: security, device: lustre, parameter: srpc.flavor.tcp103= }
      - { index: 207, event: security, device: lustre, parameter: srpc.flavor.default= }
      - { index: 222, event: security, device: lustre, parameter: srpc.flavor.default.mdt2mdt= }
      - { index: 232, event: security, device: lustre, parameter: srpc.flavor.default.mdt2ost= }
      - { index: 265, event: security, device: lustre, parameter: srpc.flavor.tcp0= }
      - { index: 268, event: security, device: lustre, parameter: srpc.flavor.tcp= }
      - { index: 327, event: security, device: lustre, parameter: srpc.flavor.tcp101.cli2ost= }
      - { index: 330, event: security, device: lustre, parameter: srpc.flavor.tcp101.cli2mdt= }
      - { index: 339, event: security, device: lustre, parameter: srpc.flavor.tcp0.cli2mdt= }
      - { index: 342, event: security, device: lustre, parameter: srpc.flavor.tcp0.cli2ost= }
      - { index: 345, event: security, device: lustre, parameter: srpc.flavor.default.cli2ost=skn }
      - { index: 348, event: security, device: lustre, parameter: srpc.flavor.default.cli2mdt=skn }
      - { index: 351, event: security, device: lustre, parameter: srpc.flavor.tcp.cli2mdt=null }
      - { index: 354, event: security, device: lustre, parameter: srpc.flavor.tcp.cli2ost=null }
      
      # Stop Lustre targets
      # Issue writeconf
      tunefs.lustre --writeconf --erase-params \
        --mgsnode=10.0.0.1@tcp0,10.16.0.1@tcp0:10.0.0.2@tcp0,10.16.0.2@tcp0 \
        --servicenode=10.0.0.1@tcp0,10.16.0.1@tcp0 \
        --servicenode=10.0.0.2@tcp0,10.16.0.2@tcp0 \
        /dev/disk/by-id/virtio-MGT
      ... # repeat for other targets
      
      # Start Lustre targets
      [servers (mt-byoip-ssk-identity)] [root@server1 ~]# lctl --device MGS llog_print lustre-sptlrpc | tee /tmp/after-sptlrpc.txt
      - { index: 103, event: security, device: lustre, parameter: srpc.flavor.lo= }
      - { index: 198, event: security, device: lustre, parameter: srpc.flavor.tcp101= }
      - { index: 201, event: security, device: lustre, parameter: srpc.flavor.tcp102= }
      - { index: 204, event: security, device: lustre, parameter: srpc.flavor.tcp103= }
      - { index: 207, event: security, device: lustre, parameter: srpc.flavor.default= }
      - { index: 222, event: security, device: lustre, parameter: srpc.flavor.default.mdt2mdt= }
      - { index: 232, event: security, device: lustre, parameter: srpc.flavor.default.mdt2ost= }
      - { index: 265, event: security, device: lustre, parameter: srpc.flavor.tcp0= }
      - { index: 268, event: security, device: lustre, parameter: srpc.flavor.tcp= }
      - { index: 327, event: security, device: lustre, parameter: srpc.flavor.tcp101.cli2ost= }
      - { index: 330, event: security, device: lustre, parameter: srpc.flavor.tcp101.cli2mdt= }
      - { index: 339, event: security, device: lustre, parameter: srpc.flavor.tcp0.cli2mdt= }
      - { index: 342, event: security, device: lustre, parameter: srpc.flavor.tcp0.cli2ost= }
      - { index: 345, event: security, device: lustre, parameter: srpc.flavor.default.cli2ost=skn }
      - { index: 348, event: security, device: lustre, parameter: srpc.flavor.default.cli2mdt=skn }
      - { index: 351, event: security, device: lustre, parameter: srpc.flavor.tcp.cli2mdt=null }
      - { index: 354, event: security, device: lustre, parameter: srpc.flavor.tcp.cli2ost=null }

      Analysis
      lctl --device MGS llog_catlist enumerates config logs by reading the on-disk CONFIGS directory (mgs_list_logs() in mgs/mgs_llog.c) and filtering each entry through two gates:

      1. An allow-list — lu_name_in_white_list() (include/lu_object.h), applied per dirent in class_dentry_readdir()
      2. A "name contains '-'" check in mgs_list_logs()

      <fsname>-sptlrpc and params are dropped here:

      • <fsname>-sptlrpc: this fails the allow-list, which only has a bare 'sptlrpc' entry, which is checked to be an exact match, but no check is made for the <fsname>-sptlrpc file.
      • params: this passes the allowlist, but fails the check in mgs_list_logs() because it contains no hyphen.

      I think this is unintentional and both should be listed.
       
      This regression also means that <fsname>-sptlrpc is invisible to multiple other commands. class_dentry_readdir() which calls lu_name_in_white_list, is the single enumerate CONFIGS function used by:

      • mgs_erase_logs
      • mgs_clear_configs
      • mgs_lcfg_fork
      • mgs_lcfg_rename
      • mgs_write_log_direct_all (however this explicitly filters out -sptlrpc logs later)

      Fixing this issue will mean that all of these cases will now, in my view correctly, clean up a filesystem's sptlrpc log. However this would mean a change in behaviour from currently. In my opinion, this is the expected behaviour anyway and the current situation is unexpected, therefore this should just be fixed.

      Let me know if this is not the case.

            mrasobarnett Matt Rásó-Barnett
            mrasobarnett Matt Rásó-Barnett
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: