]> granicus.if.org Git - zfs/commitdiff
Make zdb results for checkpoint tests consistent
authorSerapheim Dimitropoulos <serapheimd@gmail.com>
Wed, 16 Jan 2019 18:41:47 +0000 (10:41 -0800)
committerBrian Behlendorf <behlendorf1@llnl.gov>
Wed, 16 Jan 2019 18:41:47 +0000 (10:41 -0800)
This patch exports and re-imports the pool when these tests are
analyzed with zdb to get consistent results.

Reviewed by: Igor Kozhukhov <igor@dilos.org>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: George Melikov <mail@gmelikov.ru>
Signed-off-by: Serapheim Dimitropoulos <serapheim@delphix.com>
Closes #8292

tests/zfs-tests/tests/functional/pool_checkpoint/pool_checkpoint.kshlib

index 455a1d12d24e7e068476d7ed0af29da0f9cbdff1..6e410e0c85f86b1d103d8f9057f2069d31e60a92 100644 (file)
@@ -324,8 +324,19 @@ function fragment_after_checkpoint_and_verify
        #
        log_must zpool list -v
 
-       log_must zdb $NESTEDPOOL
-       log_must zdb -kc $NESTEDPOOL
+       #
+       # Typically we would just run zdb at this point and things
+       # would be fine. Unfortunately, if there is still any
+       # background I/O in the pool the zdb command can fail with
+       # checksum errors temporarily.
+       #
+       # Export the pool when running zdb so the pool is idle and
+       # the verification results are consistent.
+       #
+       log_must zpool export $NESTEDPOOL
+       log_must zdb -e -p $FILEDISKDIR $NESTEDPOOL
+       log_must zdb -e -p $FILEDISKDIR -kc $NESTEDPOOL
+       log_must zpool import -d $FILEDISKDIR $NESTEDPOOL
 }
 
 function wait_discard_finish