Project

General

Profile

Actions

Bug #5484

open

zpool upgrade with unavailable pool causes assert violation

Added by Steven Hartland over 8 years ago.

Status:
New
Priority:
Normal
Assignee:
-
Category:
-
Start date:
2014-12-26
Due date:
% Done:

0%

Estimated time:
Difficulty:
Medium
Tags:
needs-triage
Gerrit CR:
External Bug:

Description

When running zpool upgrade on a system with an unavailable pool it results in an assert violation as it tries to access the pool without checking that its unavailable.

Example output of this from FreeBSD is:
zpool upgrade:
This system supports ZFS pool feature flags.

All pools are formatted using feature flags.

Assertion failed: (nvlist_lookup_nvlist(config, "feature_stats", &features) == 0), file /usr/src/cddl/lib/libzfs/../../../cddl/contrib/opensolaris/lib/libzfs/common/libzfs_config.c, line 250.

The attached path fixes this, here is the combined commit log entries from FreeBSD:

Prevent zpool upgrade failing due to unavailable pools

Prior to this fix "zpool upgrade" and "zpool upgrade -a" would fail due to an assert when operating on unavailable pools.

Introduce a separate phase to list all unavailable pools when listing pools to upgrade. This avoids confusing output when displaying older and disabled feature pools. These existing phases now silently skip unavailable pools.

Introduce cb_unavail to upgrade_cbdata_t which enables the final output for zpool list to correctly detail if all pools or only all available pools where up-to-date on version / features.

Correct the type of upgrade_cbdata_t.cb_first from int -> boolean_t.

Change the pool iteration when upgrading named pools to include unavailable pools and update upgrade_one so it doesn't try to upgrade unavailable pools but warns about them. This allows the correct error to be displayed as well as upgrades with available and unavailable pools intermixed to partially complete.

Also correct some missing trailing \\n's from output in upgrade_one.

Relevant links:

Files

zfs-zpool-upgrade.patch (5.95 KB) zfs-zpool-upgrade.patch Steven Hartland, 2014-12-26 04:50 AM

Related issues

Related to illumos gate - Bug #6358: A faulted pool with only unavailable vdevs triggers assertion failure in libzfsClosedDan Vatca2015-10-19

Actions
Actions #1

Updated by Marcel Telka over 3 years ago

  • Related to Bug #6358: A faulted pool with only unavailable vdevs triggers assertion failure in libzfs added
Actions

Also available in: Atom PDF