summaryrefslogtreecommitdiffstats
path: root/include/sys
diff options
context:
space:
mode:
authorOlaf Faaland <[email protected]>2019-05-09 10:08:05 -0700
committerBrian Behlendorf <[email protected]>2019-05-09 10:08:05 -0700
commitca95f70dff2915a1a5d838ecafc28646f5f5a42e (patch)
tree3561bf9dba925382137582c7034d8eaf60ded8f9 /include/sys
parentb689de85e8c78b9dc03c1bd4c3ca0f4e75714e92 (diff)
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 <[email protected]> Signed-off-by: Olaf Faaland <[email protected]> Closes #8696
Diffstat (limited to 'include/sys')
-rw-r--r--include/sys/spa.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/include/sys/spa.h b/include/sys/spa.h
index 343977b30..23434edbc 100644
--- a/include/sys/spa.h
+++ b/include/sys/spa.h
@@ -965,6 +965,14 @@ extern void spa_iostats_trim_add(spa_t *spa, trim_type_t type,
uint64_t extents_written, uint64_t bytes_written,
uint64_t extents_skipped, uint64_t bytes_skipped,
uint64_t extents_failed, uint64_t bytes_failed);
+extern void spa_import_progress_add(spa_t *spa);
+extern void spa_import_progress_remove(uint64_t spa_guid);
+extern int spa_import_progress_set_mmp_check(uint64_t pool_guid,
+ uint64_t mmp_sec_remaining);
+extern int spa_import_progress_set_max_txg(uint64_t pool_guid,
+ uint64_t max_txg);
+extern int spa_import_progress_set_state(uint64_t pool_guid,
+ spa_load_state_t spa_load_state);
/* Pool configuration locks */
extern int spa_config_tryenter(spa_t *spa, int locks, void *tag, krw_t rw);