Bug #11247
open"zpool add -n" confused about adding first log device
0%
Description
Adding devices to a ZFS pool is in some instances a one-way trip, so using zpool add -n
(the dry-run mode) is advisable. In theory, at least, this prints a hypothetical summary of the vdev configuration after adding the requested devices. In practice, it seems the command is somewhat confused about how to render the addition of the first log
device to a pool that previously had no slog:
# zpool status extra pool: extra state: ONLINE scan: none requested config: NAME STATE READ WRITE CKSUM extra ONLINE 0 0 0 c3t0d0 ONLINE 0 0 0 # zpool add -n extra log /tmp/log0 would update 'extra' to the following configuration: extra c3t0d0 /tmp/log0 # zpool add extra log /tmp/log0 # zpool status extra pool: extra state: ONLINE scan: none requested config: NAME STATE READ WRITE CKSUM extra ONLINE 0 0 0 c3t0d0 ONLINE 0 0 0 logs /tmp/log0 ONLINE 0 0 0 errors: No known data errors # zpool add -n extra log /tmp/log1 would update 'extra' to the following configuration: extra c3t0d0 logs /tmp/log0 /tmp/log1 # zpool remove extra /tmp/log0 # zpool add -n extra log /tmp/log1 would update 'extra' to the following configuration: extra c3t0d0 /tmp/log1
Note that prior to adding a log device, the command rendered /tmp/log0
as if it were a regular top-level vdev. After /tmp/log0
was added, /tmp/log1
does appear correctly under the "logs" heading in the output! Removing /tmp/log0
again returns the display to being incorrect. Curiously, adding a mirrored device does show a mirror
vdev -- but still not under the "logs" heading:
# zpool add -n extra log mirror /tmp/log1 /tmp/log0 would update 'extra' to the following configuration: extra c3t0d0 mirror /tmp/log1 /tmp/log0