From 4f0728278615eb42fc5022b2817c082f578e225f Mon Sep 17 00:00:00 2001 From: Don Brady Date: Fri, 4 Sep 2020 11:34:28 -0600 Subject: Avoid posting duplicate zpool events Duplicate io and checksum ereport events can misrepresent that things are worse than they seem. Ideally the zpool events and the corresponding vdev stat error counts in a zpool status should be for unique errors -- not the same error being counted over and over. This can be demonstrated in a simple example. With a single bad block in a datafile and just 5 reads of the file we end up with a degraded vdev, even though there is only one unique error in the pool. The proposed solution to the above issue, is to eliminate duplicates when posting events and when updating vdev error stats. We now save recent error events of interest when posting events so that we can easily check for duplicates when posting an error. Reviewed by: Brad Lewis Reviewed-by: Brian Behlendorf Signed-off-by: Don Brady Closes #10861 --- include/sys/fm/fs/zfs.h | 5 +++++ include/sys/fm/util.h | 3 +++ 2 files changed, 8 insertions(+) (limited to 'include/sys/fm') diff --git a/include/sys/fm/fs/zfs.h b/include/sys/fm/fs/zfs.h index 9bfb123c7..6491606d3 100644 --- a/include/sys/fm/fs/zfs.h +++ b/include/sys/fm/fs/zfs.h @@ -23,6 +23,10 @@ * Use is subject to license terms. */ +/* + * Copyright (c) 2020 by Delphix. All rights reserved. + */ + #ifndef _SYS_FM_FS_ZFS_H #define _SYS_FM_FS_ZFS_H @@ -88,6 +92,7 @@ extern "C" { #define FM_EREPORT_PAYLOAD_ZFS_ZIO_SIZE "zio_size" #define FM_EREPORT_PAYLOAD_ZFS_ZIO_FLAGS "zio_flags" #define FM_EREPORT_PAYLOAD_ZFS_ZIO_STAGE "zio_stage" +#define FM_EREPORT_PAYLOAD_ZFS_ZIO_PRIORITY "zio_priority" #define FM_EREPORT_PAYLOAD_ZFS_ZIO_PIPELINE "zio_pipeline" #define FM_EREPORT_PAYLOAD_ZFS_ZIO_DELAY "zio_delay" #define FM_EREPORT_PAYLOAD_ZFS_ZIO_TIMESTAMP "zio_timestamp" diff --git a/include/sys/fm/util.h b/include/sys/fm/util.h index ff54b05bb..ea8c61a8b 100644 --- a/include/sys/fm/util.h +++ b/include/sys/fm/util.h @@ -104,6 +104,9 @@ extern int zfs_zevent_seek(zfs_zevent_t *, uint64_t); extern void zfs_zevent_init(zfs_zevent_t **); extern void zfs_zevent_destroy(zfs_zevent_t *); +extern void zfs_zevent_track_duplicate(void); +extern void zfs_ereport_init(void); +extern void zfs_ereport_fini(void); #else static inline void fm_init(void) { } -- cgit v1.2.3