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.

Reviewed-by: George Melikov <mail@gmelikov.ru>
Reviewed-by: Allan Jude <allan@klarasystems.com>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by:	Alexander Motin <mav@FreeBSD.org>
Sponsored by:	iXsystems, Inc.
Closes #17496
This commit is contained in:
Alexander Motin 2025-07-02 12:33:47 -04:00 committed by GitHub
parent eacf618a65
commit bf846dcb7d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
5 changed files with 30 additions and 12 deletions

View File

@ -876,6 +876,18 @@ check_replication(nvlist_t *config, nvlist_t *newroot)
(u_longlong_t)mirror->zprl_children);
ret = -1;
}
} else if (is_raidz_draid(current, new)) {
if (current->zprl_parity != new->zprl_parity) {
vdev_error(gettext(
"mismatched replication level: pool and "
"new vdev with different redundancy, %s "
"and %s vdevs, %llu vs. %llu\n"),
current->zprl_type,
new->zprl_type,
(u_longlong_t)current->zprl_parity,
(u_longlong_t)new->zprl_parity);
ret = -1;
}
} else if (strcmp(current->zprl_type, new->zprl_type) != 0) {
vdev_error(gettext(
"mismatched replication level: pool uses %s "
@ -1581,13 +1593,12 @@ construct_spec(nvlist_t *props, int argc, char **argv)
is_dedup = is_spare = B_FALSE;
}
if (is_log || is_special || is_dedup) {
if (is_log) {
if (strcmp(type, VDEV_TYPE_MIRROR) != 0) {
(void) fprintf(stderr,
gettext("invalid vdev "
"specification: unsupported '%s' "
"device: %s\n"), is_log ? "log" :
"special", type);
"specification: unsupported 'log' "
"device: %s\n"), type);
goto spec_out;
}
nlogs++;

View File

@ -41,9 +41,4 @@ log_mustnot zpool create $TESTPOOL $ZPOOL_DISKS special mirror \
log_mustnot display_status $TESTPOOL
log_mustnot zpool destroy -f $TESTPOOL
log_mustnot zpool create $TESTPOOL raidz $ZPOOL_DISKS special raidz \
$CLASS_DISK0 $CLASS_DISK1 $CLASS_DISK2
log_mustnot display_status $TESTPOOL
log_mustnot zpool destroy -f $TESTPOOL
log_pass $claim

View File

@ -32,7 +32,7 @@ log_onexit cleanup
log_must disk_setup
for type in "" "mirror" "raidz"
for type in "" "mirror" "raidz" "draid"
do
log_must zpool create $TESTPOOL $type $ZPOOL_DISKS
@ -47,6 +47,12 @@ do
$CLASS_DISK0 $CLASS_DISK1
log_must zpool iostat -H $TESTPOOL $CLASS_DISK0
log_must zpool iostat -H $TESTPOOL $CLASS_DISK1
elif [ "$type" = "draid" ]; then
log_must zpool add $TESTPOOL special raidz \
$CLASS_DISK0 $CLASS_DISK1 $CLASS_DISK2
log_must zpool iostat -H $TESTPOOL $CLASS_DISK0
log_must zpool iostat -H $TESTPOOL $CLASS_DISK1
log_must zpool iostat -H $TESTPOOL $CLASS_DISK2
else
log_must zpool add $TESTPOOL special $CLASS_DISK0
log_must zpool iostat -H $TESTPOOL $CLASS_DISK0

View File

@ -37,7 +37,7 @@ typeset ac_value
typeset stype=""
typeset sdisks=""
for type in "" "mirror" "raidz"
for type in "" "mirror" "raidz" "draid"
do
if [ "$type" = "mirror" ]; then
stype="mirror"
@ -45,6 +45,9 @@ do
elif [ "$type" = "raidz" ]; then
stype="mirror"
sdisks="${CLASS_DISK0} ${CLASS_DISK1}"
elif [ "$type" = "draid" ]; then
stype="raidz"
sdisks="${CLASS_DISK0} ${CLASS_DISK1} ${CLASS_DISK2}"
else
stype=""
sdisks="${CLASS_DISK0}"

View File

@ -36,7 +36,7 @@ typeset stype=""
typeset sdisks=""
typeset props=""
for type in "" "mirror" "raidz"
for type in "" "mirror" "raidz" "draid"
do
if [ "$type" = "mirror" ]; then
stype="mirror"
@ -45,6 +45,9 @@ do
elif [ "$type" = "raidz" ]; then
stype="mirror"
sdisks="${CLASS_DISK0} ${CLASS_DISK1}"
elif [ "$type" = "draid" ]; then
stype="raidz"
sdisks="${CLASS_DISK0} ${CLASS_DISK1} ${CLASS_DISK2}"
else
stype=""
sdisks="${CLASS_DISK0}"