Skip to content

Commit d24f07a

Browse files
committed
Release topology restrictions on special/dedup
Special vdevs were originally designed as a small blocks storage for dRAID, for which role RAIDZ/dRAID topologies are not good. But it is more often used as SSD storage for metadata and hot data of HDD pools. In these use cases narrow RAIDZ of SSDs might be fine, so we should not introduce unnecessary restrictions, and ZFS internally does not care. Similar applies to dedup vdevs. Original DDT used 4KB blocks, for which anything but mirror was a terrible storage. But new FDT implementation uses 32KB blocks by default, which are much less demanding even including compression, and which could be increased even higher now, if needed. Signed-off-by: Alexander Motin <[email protected]> Sponsored by: iXsystems, Inc.
1 parent eacf618 commit d24f07a

File tree

5 files changed

+30
-12
lines changed

5 files changed

+30
-12
lines changed

cmd/zpool/zpool_vdev.c

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -876,6 +876,18 @@ check_replication(nvlist_t *config, nvlist_t *newroot)
876876
(u_longlong_t)mirror->zprl_children);
877877
ret = -1;
878878
}
879+
} else if (is_raidz_draid(current, new)) {
880+
if (current->zprl_parity != new->zprl_parity) {
881+
vdev_error(gettext(
882+
"mismatched replication level: pool and "
883+
"new vdev with different redundancy, %s "
884+
"and %s vdevs, %llu vs. %llu\n"),
885+
current->zprl_type,
886+
new->zprl_type,
887+
(u_longlong_t)current->zprl_parity,
888+
(u_longlong_t)new->zprl_parity);
889+
ret = -1;
890+
}
879891
} else if (strcmp(current->zprl_type, new->zprl_type) != 0) {
880892
vdev_error(gettext(
881893
"mismatched replication level: pool uses %s "
@@ -1581,13 +1593,12 @@ construct_spec(nvlist_t *props, int argc, char **argv)
15811593
is_dedup = is_spare = B_FALSE;
15821594
}
15831595

1584-
if (is_log || is_special || is_dedup) {
1596+
if (is_log) {
15851597
if (strcmp(type, VDEV_TYPE_MIRROR) != 0) {
15861598
(void) fprintf(stderr,
15871599
gettext("invalid vdev "
1588-
"specification: unsupported '%s' "
1589-
"device: %s\n"), is_log ? "log" :
1590-
"special", type);
1600+
"specification: unsupported 'log' "
1601+
"device: %s\n"), type);
15911602
goto spec_out;
15921603
}
15931604
nlogs++;

tests/zfs-tests/tests/functional/alloc_class/alloc_class_002_neg.ksh

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,4 @@ log_mustnot zpool create $TESTPOOL $ZPOOL_DISKS special mirror \
4141
log_mustnot display_status $TESTPOOL
4242
log_mustnot zpool destroy -f $TESTPOOL
4343

44-
log_mustnot zpool create $TESTPOOL raidz $ZPOOL_DISKS special raidz \
45-
$CLASS_DISK0 $CLASS_DISK1 $CLASS_DISK2
46-
log_mustnot display_status $TESTPOOL
47-
log_mustnot zpool destroy -f $TESTPOOL
48-
4944
log_pass $claim

tests/zfs-tests/tests/functional/alloc_class/alloc_class_003_pos.ksh

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ log_onexit cleanup
3232

3333
log_must disk_setup
3434

35-
for type in "" "mirror" "raidz"
35+
for type in "" "mirror" "raidz" "draid"
3636
do
3737
log_must zpool create $TESTPOOL $type $ZPOOL_DISKS
3838

@@ -47,6 +47,12 @@ do
4747
$CLASS_DISK0 $CLASS_DISK1
4848
log_must zpool iostat -H $TESTPOOL $CLASS_DISK0
4949
log_must zpool iostat -H $TESTPOOL $CLASS_DISK1
50+
elif [ "$type" = "draid" ]; then
51+
log_must zpool add $TESTPOOL special raidz \
52+
$CLASS_DISK0 $CLASS_DISK1 $CLASS_DISK2
53+
log_must zpool iostat -H $TESTPOOL $CLASS_DISK0
54+
log_must zpool iostat -H $TESTPOOL $CLASS_DISK1
55+
log_must zpool iostat -H $TESTPOOL $CLASS_DISK2
5056
else
5157
log_must zpool add $TESTPOOL special $CLASS_DISK0
5258
log_must zpool iostat -H $TESTPOOL $CLASS_DISK0

tests/zfs-tests/tests/functional/alloc_class/alloc_class_004_pos.ksh

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,14 +37,17 @@ typeset ac_value
3737
typeset stype=""
3838
typeset sdisks=""
3939

40-
for type in "" "mirror" "raidz"
40+
for type in "" "mirror" "raidz" "draid"
4141
do
4242
if [ "$type" = "mirror" ]; then
4343
stype="mirror"
4444
sdisks="${CLASS_DISK0} ${CLASS_DISK1} ${CLASS_DISK2}"
4545
elif [ "$type" = "raidz" ]; then
4646
stype="mirror"
4747
sdisks="${CLASS_DISK0} ${CLASS_DISK1}"
48+
elif [ "$type" = "draid" ]; then
49+
stype="raidz"
50+
sdisks="${CLASS_DISK0} ${CLASS_DISK1} ${CLASS_DISK2}"
4851
else
4952
stype=""
5053
sdisks="${CLASS_DISK0}"

tests/zfs-tests/tests/functional/alloc_class/alloc_class_009_pos.ksh

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ typeset stype=""
3636
typeset sdisks=""
3737
typeset props=""
3838

39-
for type in "" "mirror" "raidz"
39+
for type in "" "mirror" "raidz" "draid"
4040
do
4141
if [ "$type" = "mirror" ]; then
4242
stype="mirror"
@@ -45,6 +45,9 @@ do
4545
elif [ "$type" = "raidz" ]; then
4646
stype="mirror"
4747
sdisks="${CLASS_DISK0} ${CLASS_DISK1}"
48+
elif [ "$type" = "draid" ]; then
49+
stype="raidz"
50+
sdisks="${CLASS_DISK0} ${CLASS_DISK1} ${CLASS_DISK2}"
4851
else
4952
stype=""
5053
sdisks="${CLASS_DISK0}"

0 commit comments

Comments
 (0)