Project

General

Profile

Bug #8941

zpool add: assertion failed in get_replication() with nested interior VDEVs

Added by Ezomori Nozomu over 1 year ago. Updated over 1 year ago.

Status:
Closed
Priority:
Low
Category:
zfs - Zettabyte File System
Start date:
2017-12-28
Due date:
% Done:

100%

Estimated time:
Difficulty:
Medium
Tags:

Description

When replacing a faulted device which was previously handled by a spare multiple levels of nested interior VDEVs will be present in the pool configuration: get_replication() needs to handle this situation gracefully to let zpool add new devices to the pool:

root@openindiana:~# POOLNAME='testpool'
root@openindiana:~# TMPDIR='/var/tmp'
root@openindiana:~# sudo zinject -c all
removed all registered handlers
root@openindiana:~# sudo zpool destroy -f $POOLNAME
root@openindiana:~# rm -f $TMPDIR/file-vdev* rm -f $TMPDIR/file-spare*
root@openindiana:~# truncate -s 512m $TMPDIR/file-vdev1
root@openindiana:~# truncate -s 512m $TMPDIR/file-vdev2
root@openindiana:~# sudo zpool create -f -O mountpoint=none $POOLNAME mirror $TMPDIR/file-vdev1 $TMPDIR/file-vdev2
root@openindiana:~# truncate -s 512m $TMPDIR/file-spare1
root@openindiana:~# sudo zpool add $POOLNAME spare $TMPDIR/file-spare1
root@openindiana:~# sudo zinject -d $TMPDIR/file-vdev2 -e nxio -T all -f 100 $POOLNAME
Added handler 1 with the following properties:
  pool: testpool
  vdev: 79ad17dc1b97bcd5
root@openindiana:~# sudo zpool scrub $POOLNAME
root@openindiana:~# sleep 1
root@openindiana:~# truncate -s 512m $TMPDIR/file-vdev3
root@openindiana:~# sudo zpool replace $POOLNAME $TMPDIR/file-vdev2 $TMPDIR/file-vdev3
root@openindiana:~# truncate -s 512m $TMPDIR/file-spare2
root@openindiana:~# sudo zpool add $POOLNAME spare $TMPDIR/file-spare2
Assertion failed: nvlist_lookup_string(cnv, "path", &path) == 0, file zpool_vdev.c, line 651
Abort
root@openindiana:~# sudo zpool add $POOLNAME $TMPDIR/file-spare2
Assertion failed: nvlist_lookup_string(cnv, "path", &path) == 0, file zpool_vdev.c, line 651
Abort
root@openindiana:~# uname -a
SunOS openindiana 5.11 master-0-gb3c0a3b184 i86pc i386 i86pc
root@openindiana:~# zpool status $POOLNAME
  pool: testpool
 state: DEGRADED
  scan: resilvered 308K in 0h0m with 0 errors on Thu Dec 28 21:46:20 2017
config:

        NAME                         STATE     READ WRITE CKSUM
        testpool                     DEGRADED     0     0     0
          mirror-0                   DEGRADED     0     0     0
            /var/tmp/file-vdev1      ONLINE       0     0     0
            spare-1                  UNAVAIL      0     0     0
              replacing-0            UNAVAIL      0     0     0
                /var/tmp/file-vdev2  UNAVAIL      0     0     0  cannot open
                /var/tmp/file-vdev3  ONLINE       0     0     0
              /var/tmp/file-spare1   ONLINE       0     0     0
        spares
          /var/tmp/file-spare1       INUSE     currently in use

errors: No known data errors
root@openindiana:~# 

Reported on the ZFSonLinux github repo, fixed by https://github.com/zfsonlinux/zfs/pull/6996.

History

#1

Updated by Electric Monk over 1 year ago

  • Status changed from New to Closed

git commit ac0215f4d618163d117a40fbf77a3f944852cb7b

commit  ac0215f4d618163d117a40fbf77a3f944852cb7b
Author: loli10K <ezomori.nozomu@gmail.com>
Date:   2018-02-08T05:16:38.000Z

    8941 zpool add: assertion failed in get_replication() with nested interior VDEVs
    Reviewed by: Matthew Ahrens <mahrens@delphix.com>
    Reviewed by: Andrew Stormont <andyjstormont@gmail.com>
    Approved by: Dan McDonald <danmcd@joyent.com>

Also available in: Atom PDF