-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Alter zpool status output to indicate MMP suspended the pool #7296
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
cmd/zpool/zpool_main.c
Outdated
"system could import the pool undetected.\n")); | ||
(void) printf(gettext("action: Make sure the pool's devices " | ||
"are connected, then reboot your system and import the " | ||
"pool.\n")); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please mind the 80 char limit in the output, both of these lines need to be manually wrapped with \n\t\
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed.
cmd/zpool/zpool_main.c
Outdated
@@ -6467,6 +6467,15 @@ status_callback(zpool_handle_t *zhp, void *data) | |||
"to be recovered.\n")); | |||
break; | |||
|
|||
case ZPOOL_STATUS_IO_FAILURE_MMP: | |||
(void) printf(gettext("status: The pool is suspended because " | |||
"multihost writes failed or were delayed, and another " |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To my ear the phrasing here doesn't flow quite right, maybe replace ", and another system..." with "; another system...".
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
f7dd71e
to
17d79ec
Compare
Codecov Report
@@ Coverage Diff @@
## master #7296 +/- ##
==========================================
- Coverage 76.36% 76.2% -0.17%
==========================================
Files 328 328
Lines 104023 104011 -12
==========================================
- Hits 79439 79263 -176
- Misses 24584 24748 +164
Continue to review full report at Codecov.
|
include/sys/zio.h
Outdated
ZIO_SUSPEND_NONE = 0, | ||
ZIO_SUSPEND_IOERR, | ||
ZIO_SUSPEND_MMP, | ||
}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add zio_suspend_reason_t
as a typedef and use that throughout.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed
When the pool is suspended, record whether it was due to an I/O error or due to MMP writes failing to succeed within the required time. Change spa_suspended from uint8_t to zio_suspend_reason_t to store the reason. When userspace queries pool status via spa_tryimport(), report the reason the pool was suspended in a new key, ZPOOL_CONFIG_SUSPENDED_REASON. In libzfs, when interpreting the returned config nvlist, report suspension due to MMP with a new pool status enum value, ZPOOL_STATUS_IO_FAILURE_MMP. In status_callback(), which generates and emits the message when 'zpool status' is executed, add a case to print an appropriate message for the new pool status enum value. Signed-off-by: Olaf Faaland <[email protected]>
17d79ec
to
543d0a6
Compare
When the pool is suspended, record whether it was due to an I/O error or due to MMP writes failing to succeed within the required time. Change spa_suspended from uint8_t to zio_suspend_reason_t to store the reason. When userspace queries pool status via spa_tryimport(), report the reason the pool was suspended in a new key, ZPOOL_CONFIG_SUSPENDED_REASON. In libzfs, when interpreting the returned config nvlist, report suspension due to MMP with a new pool status enum value, ZPOOL_STATUS_IO_FAILURE_MMP. In status_callback(), which generates and emits the message when 'zpool status' is executed, add a case to print an appropriate message for the new pool status enum value. Reviewed-by: George Melikov <[email protected]> Reviewed-by: Giuseppe Di Natale <[email protected]> Reviewed-by: Brian Behlendorf <[email protected]> Reviewed-by: Tony Hutter <[email protected]> Signed-off-by: Olaf Faaland <[email protected]> Closes openzfs#7296
When the pool is suspended, record whether it was due to an I/O error or due to MMP writes failing to succeed within the required time. Change spa_suspended from uint8_t to zio_suspend_reason_t to store the reason. When userspace queries pool status via spa_tryimport(), report the reason the pool was suspended in a new key, ZPOOL_CONFIG_SUSPENDED_REASON. In libzfs, when interpreting the returned config nvlist, report suspension due to MMP with a new pool status enum value, ZPOOL_STATUS_IO_FAILURE_MMP. In status_callback(), which generates and emits the message when 'zpool status' is executed, add a case to print an appropriate message for the new pool status enum value. Reviewed-by: George Melikov <[email protected]> Reviewed-by: Giuseppe Di Natale <[email protected]> Reviewed-by: Brian Behlendorf <[email protected]> Reviewed-by: Tony Hutter <[email protected]> Signed-off-by: Olaf Faaland <[email protected]> Closes openzfs#7296
When the pool is suspended, record whether it was due to an I/O error or due to MMP writes failing to succeed within the required time. Change spa_suspended from uint8_t to zio_suspend_reason_t to store the reason. When userspace queries pool status via spa_tryimport(), report the reason the pool was suspended in a new key, ZPOOL_CONFIG_SUSPENDED_REASON. In libzfs, when interpreting the returned config nvlist, report suspension due to MMP with a new pool status enum value, ZPOOL_STATUS_IO_FAILURE_MMP. In status_callback(), which generates and emits the message when 'zpool status' is executed, add a case to print an appropriate message for the new pool status enum value. Reviewed-by: George Melikov <[email protected]> Reviewed-by: Giuseppe Di Natale <[email protected]> Reviewed-by: Brian Behlendorf <[email protected]> Reviewed-by: Tony Hutter <[email protected]> Signed-off-by: Olaf Faaland <[email protected]> Closes #7296
Description
When the pool is suspended, record whether it was due to an I/O error
or due to MMP writes failing to succeed within the required time.
When userspace queries pool status via spa_tryimport(), report the
reason the pool was suspended in a new key,
ZPOOL_CONFIG_SUSPENDED_REASON.
In libzfs, when interpreting the returned config nvlist, report
suspension due to MMP with a new pool status enum value,
ZPOOL_STATUS_IO_FAILURE_MMP.
In status_callback(), which generates and emits the message when 'zpool
status' is executed, add a case to print an appropriate message for the
new pool status enum value.
Motivation and Context
Before this change, the 'zpool status' output did not indicate MMP might be the reason the pool was suspended, and instructed the user to run 'zpool clear' which is confusing (there may be no device FAULTED) and incorrect (only a reboot clears the condition at this time). The latter is a bug which should be fixed, but the instructions to the user should be correct in the meantime.
Similarly, the libzfs code for parsing the config nvlist and producing an enum value reflecting the pool status did not reflect an MMP failure when that had occurred.
How Has This Been Tested?
I ran zloop and the mmp portion of the ZTS locally.
Types of changes
Checklist:
Signed-off-by
.