zpool status

Dave Baukus daveb at spectralogic.com
Fri May 15 22:00:14 UTC 2020


Formerly, zpool status -v <pool> would place a "resilvering" tag in the status.
For example:

# zpool status -v Test
  pool: Test
 state: DEGRADED
status: One or more devices is currently being resilvered.  The pool will
        continue to function, possibly in a degraded state.
action: Wait for the resilver to complete.
  scan: resilver in progress since Tue May 12 16:29:56 2020
        92.8G scanned out of 295G at 292M/s, 0h11m to go
        46.1G resilvered, 31.50% done
config:
        NAME                        STATE     READ WRITE CKSUM
        Test                        DEGRADED     0     0     0
          mirror-0                  ONLINE       0     0     0
            da5                     ONLINE       0     0     0
            da3                     ONLINE       0     0     0
          mirror-1                  DEGRADED     0     0     0
            da6                     ONLINE       0     0     0
            spare-1                 REMOVED      0     0     0
              12757033556734836956  REMOVED      0     0     0  was /dev/da8
              da9                   ONLINE       0     0     0  (resilvering)
        spares
          4617773861959656281       INUSE     was /dev/da9
errors: No known data errors

The code in zpool is:
print_status_config() {
...
...
...
        (void) nvlist_lookup_uint64_array(nv, ZPOOL_CONFIG_SCAN_STATS,
            (uint64_t **)&ps, &c);

        if (ps != NULL && ps->pss_state == DSS_SCANNING &&
            vs->vs_scan_processed != 0 && children == 0) {
                (void) printf(gettext("  (%s)"),
                    (ps->pss_func == POOL_SCAN_RESILVER) ?
                    "resilvering" : "repairing");
        }

I believe the above code is now dead because this change made it a no-op:
        MFV r331695, 331700: 9166 zfs storage pool checkpoint
        illumos/illumos-gate at 8671400134a11c848244896ca51a7db4d0f69da4

The above change introduced this function:
root_vdev_actions_getprogress(vdev_t *vd, nvlist_t *nvl)
{
        spa_t *spa = vd->vdev_spa;
        if (vd != spa->spa_root_vdev)
                return;
        /* provide either current or previous scan information */
        pool_scan_stat_t ps;
        if (spa_scan_get_stats(spa, &ps) == 0) {
                fnvlist_add_uint64_array(nvl,
                    ZPOOL_CONFIG_SCAN_STATS, (uint64_t *)&ps,
                    sizeof (pool_scan_stat_t) / sizeof (uint64_t));
        }
...
}

As one can see, we now only get ZPOOL_CONFIG_SCAN_STATS for the root vdev, thus the nvlist for a child resilvering vdev never gets tagged by zpool. Before root_vdev_actions_getprogress() was introduced, the code always retrieved ZPOOL_CONFIG_SCAN_STATS

My quick fix would be to move the root vdev check to after spa_scan_get_stats().
Or remove the dead code in zpool_main.c

--
Dave Baukus



More information about the freebsd-fs mailing list