xref: /illumos-gate/usr/src/test/zfs-tests/tests/functional/pool_checkpoint/checkpoint_sm_scale.ksh (revision e153cda9f9660e385e8f468253f80e59f5d454d7)
1#!/usr/bin/ksh -p
2
3#
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
7# 1.0 of the CDDL.
8#
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.
12#
13
14#
15# Copyright (c) 2017 by Delphix. All rights reserved.
16#
17
18. $STF_SUITE/tests/functional/pool_checkpoint/pool_checkpoint.kshlib
19
20#
21# DESCRIPTION:
22#	The maximum address that can be described by the current space
23#	map design (assuming the minimum 512-byte addressable storage)
24#	limits the maximum allocatable space of any top-level vdev to
25#	64PB whenever a vdev-wide space map is used.
26#
27#	Since a vdev-wide space map is introduced for the checkpoint
28#	we want to ensure that we cannot checkpoint a pool that has a
29#	top-level vdev with more than 64PB of allocatable space.
30#
31#	Note: Since this is a pool created from file-based vdevs we
32#	      are guaranteed that vdev_ashift  is SPA_MINBLOCKSHIFT
33#	      [which is currently 9 and (1 << 9) = 512], so the numbers
34#	      work out for this test.
35#
36# STRATEGY:
37#	1. Create pool with a disk of exactly 64PB
38#	   (so ~63.5PB of allocatable space)
39#	2. Ensure that you can checkpoint it
40#	3. Create pool with a disk of exactly 65PB
41#	   (so ~64.5PB of allocatable space)
42#	4. Ensure we fail trying to checkpoint it
43#
44
45verify_runnable "global"
46
47TESTPOOL1=testpool1
48TESTPOOL2=testpool2
49
50DISK64PB=/$DISKFS/disk64PB
51DISK65PB=/$DISKFS/disk65PB
52
53function test_cleanup
54{
55	poolexists $TESTPOOL1 && destroy_pool $TESTPOOL1
56	poolexists $TESTPOOL2 && destroy_pool $TESTPOOL2
57	log_must rm -f $DISK64PB $DISK65PB
58	cleanup_test_pool
59}
60
61setup_test_pool
62log_onexit test_cleanup
63
64log_must zfs create $DISKFS
65log_must mkfile -n $((64 * 1024 * 1024))g $DISK64PB
66log_must mkfile -n $((65 * 1024 * 1024))g $DISK65PB
67
68log_must zpool create $TESTPOOL1 $DISK64PB
69log_must zpool create $TESTPOOL2 $DISK65PB
70
71log_must zpool checkpoint $TESTPOOL1
72log_mustnot zpool checkpoint $TESTPOOL2
73
74log_pass "Attempting to checkpoint a pool with a vdev that's more than 64PB."
75