Project

General

Profile

Bug #11247

"zpool add -n" confused about adding first log device

Added by Joshua M. Clulow 4 months ago. Updated 3 months ago.

Status:
New
Priority:
Normal
Assignee:
-
Category:
zfs - Zettabyte File System
Start date:
Due date:
% Done:

0%

Estimated time:
Difficulty:
Medium
Tags:

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

History

#1

Updated by Joshua M. Clulow 4 months ago

  • Description updated (diff)
#2

Updated by Patrick Mooney 3 months ago

This just burned me today as well.

Also available in: Atom PDF