4 # This file and its contents are supplied under the terms of the
5 # Common Development and Distribution License ("CDDL"), version 1.0.
6 # You may only use this file in accordance with the terms of version
9 # A full copy of the text of the CDDL should have accompanied this
10 # source. A copy of the CDDL is also available via the Internet at
11 # http://www.illumos.org/license/CDDL.
15 # Copyright (c) 2017, 2018 by Delphix. All rights reserved.
18 . $STF_SUITE/tests/functional/pool_checkpoint/pool_checkpoint.kshlib
22 # Rewind to checkpoint on a stressed pool. We basically try to
23 # fragment the pool before and after taking a checkpoint and
24 # see if zdb finds any checksum or other errors that imply that
25 # blocks from the checkpoint have been reused.
28 # 1. Import pool that's slightly fragmented
30 # 3. Apply a destructive action and do more random writes
31 # 4. Run zdb on both current and checkpointed data and make
32 # sure that zdb returns with no errors
33 # 5. Rewind to checkpoint
37 verify_runnable "global"
39 setup_nested_pool_state
40 log_onexit cleanup_nested_pools
42 log_must zpool checkpoint $NESTEDPOOL
45 # Destroy one dataset, modify an existing one and create a
46 # a new one. Do more random writes in an attempt to raise
47 # more fragmentation. Then verify both current and checkpointed
50 fragment_after_checkpoint_and_verify
52 log_must zpool export $NESTEDPOOL
53 log_must zpool import -d $FILEDISKDIR --rewind-to-checkpoint $NESTEDPOOL
55 log_must zdb $NESTEDPOOL
57 log_pass "Rewind to checkpoint on a stressed pool."