]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
zpool import cachefile improvements
authorGeorge Wilson <george.wilson@delphix.com>
Fri, 12 Mar 2021 23:42:27 +0000 (17:42 -0600)
committerGitHub <noreply@github.com>
Fri, 12 Mar 2021 23:42:27 +0000 (15:42 -0800)
commit0936981d8698f0f05db69bb8efeb67fe5f810d2f
tree253d656a172ed0ecb4f76d2dd10fc749762c9871
parentb8fa03efbc721ee98ad9d5e0bf9ce6f72f2a8eb2
zpool import cachefile improvements

Importing a pool using the cachefile is ideal to reduce the time
required to import a pool. However, if the devices associated with
a pool in the cachefile have changed, then the import would fail.
This can easily be corrected by doing a normal import which would
then read the pool configuration from the labels.

The goal of this change is make importing using a cachefile more
resilient and auto-correcting. This is accomplished by having
the cachefile import logic automatically fallback to reading the
labels of the devices similar to a normal import. The main difference
between the fallback logic and a normal import is that the cachefile
import logic will only look at the device directories that were
originally used when the cachefile was populated. Additionally,
the fallback logic will always import by guid to ensure that only
the pools in the cachefile would be imported.

External-issue: DLPX-71980
Reviewed-by: Matthew Ahrens <mahrens@delphix.com>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: George Wilson <gwilson@delphix.com>
Closes #11716
cmd/zpool/zpool_main.c
lib/libzutil/zutil_import.c
tests/runfiles/common.run
tests/zfs-tests/tests/functional/cli_root/zpool_import/Makefile.am
tests/zfs-tests/tests/functional/cli_root/zpool_import/import_cachefile_paths_changed.ksh [new file with mode: 0755]