From e11a47da71a2e2482e4c4cf582d663cd76a2ecab Mon Sep 17 00:00:00 2001 From: Tony Hutter Date: Thu, 11 Mar 2021 17:23:16 -0800 Subject: [PATCH] LU-12836 osd-zfs: Catch all ZFS pool change events This change adds the following symlinks: vdev_attach-lustre -> statechange-lustre.sh vdev_remove-lustre -> statechange-lustre.sh vdev_clear-lustre -> statechange-lustre.sh This makes it so the statechange-lustre.sh script is also called on all ZFS events that could change the pool state. Signed-off-by: Tony Hutter Change-Id: I18edc86749e8ab91bb45f21aafd3fd47e78cbaef Reviewed-on: https://review.whamcloud.com/43552 Reviewed-by: Olaf Faaland-LLNL Tested-by: jenkins Tested-by: Maloo Reviewed-by: Nathaniel Clark Reviewed-by: Oleg Drokin --- lustre/scripts/Makefile.am | 4 +++- lustre/scripts/statechange-lustre.sh | 4 ++++ lustre/scripts/vdev_attach-lustre.sh | 1 + lustre/scripts/vdev_clear-lustre.sh | 1 + lustre/scripts/vdev_remove-lustre.sh | 1 + 5 files changed, 10 insertions(+), 1 deletion(-) create mode 120000 lustre/scripts/vdev_attach-lustre.sh create mode 120000 lustre/scripts/vdev_clear-lustre.sh create mode 120000 lustre/scripts/vdev_remove-lustre.sh diff --git a/lustre/scripts/Makefile.am b/lustre/scripts/Makefile.am index 6db837c..bdadab4 100644 --- a/lustre/scripts/Makefile.am +++ b/lustre/scripts/Makefile.am @@ -67,7 +67,8 @@ ha_SCRIPTS = Lustre.ha_v2 if ZFS_ENABLED zedletdir = $(sysconfdir)/zfs/zed.d/ -zedlet_SCRIPTS = statechange-lustre.sh +zedlet_SCRIPTS = statechange-lustre.sh vdev_attach-lustre.sh \ + vdev_remove-lustre.sh vdev_clear-lustre.sh endif scriptlibdir = @libexecdir@/@PACKAGE@ @@ -92,6 +93,7 @@ EXTRA_DIST = license-status lustre_rmmod ldev lc_mon lhbadm \ $(addsuffix .in,$(genscripts)) lfs_migrate lustre_req_history \ lustre lsvcgss lc_common haconfig Lustre.ha_v2 dkms.mkconf \ zfsobj2fid ko2iblnd-probe statechange-lustre.sh \ + vdev_attach-lustre.sh vdev_remove-lustre.sh vdev_clear-lustre.sh \ bash-completion/lustre bash-completion/lctl bash-completion/lfs CLEANFILES = $(genscripts) diff --git a/lustre/scripts/statechange-lustre.sh b/lustre/scripts/statechange-lustre.sh index 5c72ce4..43b3389 100755 --- a/lustre/scripts/statechange-lustre.sh +++ b/lustre/scripts/statechange-lustre.sh @@ -29,6 +29,10 @@ # 2: zpool missing # 3: zfs missing # 4: Pool status neither "ONLINE" nor "DEGRADED +# +# This script is also symlinked as vdev_attach-lustre.sh, vdev_remove-lustre.sh +# and vdev_clear-lustre.sh, since it needs to take the same action on those +# ZFS events as well. [ -f "${ZED_ZEDLET_DIR}/zed.rc" ] && . "${ZED_ZEDLET_DIR}/zed.rc" . "${ZED_ZEDLET_DIR}/zed-functions.sh" diff --git a/lustre/scripts/vdev_attach-lustre.sh b/lustre/scripts/vdev_attach-lustre.sh new file mode 120000 index 0000000..5b1b0ed --- /dev/null +++ b/lustre/scripts/vdev_attach-lustre.sh @@ -0,0 +1 @@ +statechange-lustre.sh \ No newline at end of file diff --git a/lustre/scripts/vdev_clear-lustre.sh b/lustre/scripts/vdev_clear-lustre.sh new file mode 120000 index 0000000..5b1b0ed --- /dev/null +++ b/lustre/scripts/vdev_clear-lustre.sh @@ -0,0 +1 @@ +statechange-lustre.sh \ No newline at end of file diff --git a/lustre/scripts/vdev_remove-lustre.sh b/lustre/scripts/vdev_remove-lustre.sh new file mode 120000 index 0000000..5b1b0ed --- /dev/null +++ b/lustre/scripts/vdev_remove-lustre.sh @@ -0,0 +1 @@ +statechange-lustre.sh \ No newline at end of file -- 1.8.3.1