]> granicus.if.org Git - zfs/commit
zpool import progress kstat
authorOlaf Faaland <faaland1@llnl.gov>
Thu, 9 May 2019 17:08:05 +0000 (10:08 -0700)
committerBrian Behlendorf <behlendorf1@llnl.gov>
Thu, 9 May 2019 17:08:05 +0000 (10:08 -0700)
commitca95f70dff2915a1a5d838ecafc28646f5f5a42e
tree3561bf9dba925382137582c7034d8eaf60ded8f9
parentb689de85e8c78b9dc03c1bd4c3ca0f4e75714e92
zpool import progress kstat

When an import requires a long MMP activity check, or when the user
requests pool recovery, the import make take a long time.  The user may
not know why, or be able to tell whether the import is progressing or is
hung.

Add a kstat which lists all imports currently being processed by the
kernel (currently only one at a time is possible, but the kstat allows
for more than one).  The kstat is /proc/spl/kstat/zfs/import_progress.

The kstat contents are as follows:
pool_guid         load_state multihost_secs  max_txg pool_name
16667015954387398 3          15              0       tank3

load_state: the value of spa_load_state
multihost_secs:  seconds until the end of the multihost activity
                 check; if over, or none required, this is 0
max_txg: current spa_load_max_txg, if rewind is occurring

This could be used by outside tools, such as a pacemaker resource agent,
to report import progress, or as a part of manual troubleshooting.  The
zpool import subcommand could also be modified to report this
information.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Olaf Faaland <faaland1@llnl.gov>
Closes #8696
include/sys/spa.h
module/zfs/spa.c
module/zfs/spa_misc.c