Skip to content

Commit a199cac

Browse files
robnbehlendorf
authored andcommitted
status: report pool suspension state under failmode=continue
When failmode=continue is set and the pool suspends, both 'zpool status' and the 'zfs/pool/state' kstat ignore it and report the normal vdev tree state. There's no clear indicator that the pool is suspended. This is unlike suspend in failmode=wait, or suspend due to MMP check failure, which both report "SUSPENDED" explicitly. This commit changes it so SUSPENDED is reported for failmode=continue the same as for other modes. Rationale: The historical behaviour of failmode=continue is roughly, "press on as though all is well". To this end, the fact that the pool had suspended was not shown, to maintain the façade that all is well. Its unclear why hiding this information was considered appropriate. One possibility is that it was expected that a true pool fault would always be reported as DEGRADED or FAULTED, and that the pool could not suspend without these happening. That is not necessarily true, as vdev health and suspend state are only loosely connected, such that a pool in (apparent) good health can be suspended for good reasons, and of course a degraded pool does not lead to suspension. Even if that expectation were true, there's still a difference in urgency - a degraded pool may not need to be attended to for hours, while a suspended pool is most often unusable until an operator intervenes. An operator that has set failmode=continue has presumably done so because their workload is one that can continue to operate in a useful way when the pool suspends. In this case the operator still needs a clear indicator that there is a problem that needs attending to. Sponsored-by: Klara, Inc. Sponsored-by: Wasabi Technology, Inc. Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Rob Norris <[email protected]> Closes #15297
1 parent 729507d commit a199cac

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

lib/libzfs/libzfs_pool.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
* Copyright (c) 2017, Intel Corporation.
3030
* Copyright (c) 2018, loli10K <[email protected]>
3131
* Copyright (c) 2021, Colm Buckley <[email protected]>
32-
* Copyright (c) 2021, Klara Inc.
32+
* Copyright (c) 2021, 2023, Klara Inc.
3333
*/
3434

3535
#include <errno.h>
@@ -255,6 +255,7 @@ zpool_get_state_str(zpool_handle_t *zhp)
255255
if (zpool_get_state(zhp) == POOL_STATE_UNAVAIL) {
256256
str = gettext("FAULTED");
257257
} else if (status == ZPOOL_STATUS_IO_FAILURE_WAIT ||
258+
status == ZPOOL_STATUS_IO_FAILURE_CONTINUE ||
258259
status == ZPOOL_STATUS_IO_FAILURE_MMP) {
259260
str = gettext("SUSPENDED");
260261
} else {

module/zfs/spa_misc.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
* Copyright (c) 2017 Datto Inc.
2828
* Copyright (c) 2017, Intel Corporation.
2929
* Copyright (c) 2019, loli10K <[email protected]>. All rights reserved.
30+
* Copyright (c) 2023, Klara Inc.
3031
*/
3132

3233
#include <sys/zfs_context.h>
@@ -2756,8 +2757,7 @@ spa_state_to_name(spa_t *spa)
27562757
vdev_state_t state = rvd->vdev_state;
27572758
vdev_aux_t aux = rvd->vdev_stat.vs_aux;
27582759

2759-
if (spa_suspended(spa) &&
2760-
(spa_get_failmode(spa) != ZIO_FAILURE_MODE_CONTINUE))
2760+
if (spa_suspended(spa))
27612761
return ("SUSPENDED");
27622762

27632763
switch (state) {

0 commit comments

Comments
 (0)