From 30d0ec85a7dfd53da737478976c0d22c4445e377 Mon Sep 17 00:00:00 2001 From: Pingfan Liu Date: Tue, 18 Feb 2025 09:55:03 +0800 Subject: [PATCH 1/3] fence_kdump: Shorten the interval between two message Resolves: https://issues.redhat.com/browse/RHEL-46337 As man 8 fence_kdump_send: -i, --interval=INTERVAL Time to wait between sending a message. The value for INTERVAL must be greater than zero. (default: 10) The interval 10 seconds are two large especially in the case that local dumping goes fast. Suppose the following scenario: network is not ready fence_kdump_notify & network is ready local dumping finish and reboot within 10 seconds. We will miss the chance to send out the fence dump messages. Shorten the interval to one second to ease this issue. Signed-off-by: Pingfan Liu --- dracut/99kdumpbase/kdump.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dracut/99kdumpbase/kdump.sh b/dracut/99kdumpbase/kdump.sh index fe50a5d1..a9cb4804 100755 --- a/dracut/99kdumpbase/kdump.sh +++ b/dracut/99kdumpbase/kdump.sh @@ -68,7 +68,7 @@ get_kdump_confs() { KDUMP_POST="$config_val" ;; fence_kdump_args) - FENCE_KDUMP_ARGS="$config_val" + FENCE_KDUMP_ARGS="$config_val -i 1" ;; fence_kdump_nodes) FENCE_KDUMP_NODES="$config_val" From 4fbccfcf966b5c1667d43d259db5f28b9e7f594b Mon Sep 17 00:00:00 2001 From: Pingfan Liu Date: Mon, 10 Feb 2025 17:19:52 +0800 Subject: [PATCH 2/3] kdump.sh: Split out get_host_ip for reusing Resolves: https://issues.redhat.com/browse/RHEL-46337 Signed-off-by: Pingfan Liu --- dracut/99kdumpbase/kdump.sh | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/dracut/99kdumpbase/kdump.sh b/dracut/99kdumpbase/kdump.sh index a9cb4804..660fb5d1 100755 --- a/dracut/99kdumpbase/kdump.sh +++ b/dracut/99kdumpbase/kdump.sh @@ -533,10 +533,6 @@ wait_online_network() { get_host_ip() { - if ! is_nfs_dump_target && ! is_ssh_dump_target; then - return 0 - fi - _kdump_remote_ip=$(getarg kdump_remote_ip=) if [ -z "$_kdump_remote_ip" ]; then @@ -560,6 +556,14 @@ get_host_ip() { HOST_IP=$_kdumpip } +remote_dump_wait_host_ip() { + + if ! is_nfs_dump_target && ! is_ssh_dump_target; then + return 0 + fi + get_host_ip +} + read_kdump_confs() { if [ ! -f "$KDUMP_CONFIG_FILE" ]; then derror "$KDUMP_CONFIG_FILE not found" @@ -659,8 +663,8 @@ fi read_kdump_confs fence_kdump_notify -if ! get_host_ip; then - derror "get_host_ip exited with non-zero status!" +if ! remote_dump_wait_host_ip; then + derror "remote_dump_wait_host_ip exited with non-zero status!" exit 1 fi From 3629422da25c4893128076e3f65d836029a3da3a Mon Sep 17 00:00:00 2001 From: Pingfan Liu Date: Mon, 10 Feb 2025 17:39:29 +0800 Subject: [PATCH 3/3] fence_kdump: Try best to send fence message before rebooting Resolves: https://issues.redhat.com/browse/RHEL-46337 fence_kdump_send may fail to send a message if the network is slow to initialize while local dumping completes quickly. To address this, add an additional wait for the network and make a best effort to send the message before rebooting. Signed-off-by: Pingfan Liu --- dracut/99kdumpbase/kdump.sh | 8 ++++++++ kdump-lib-initramfs.sh | 8 ++++++++ 2 files changed, 16 insertions(+) diff --git a/dracut/99kdumpbase/kdump.sh b/dracut/99kdumpbase/kdump.sh index 660fb5d1..2c2f5ff9 100755 --- a/dracut/99kdumpbase/kdump.sh +++ b/dracut/99kdumpbase/kdump.sh @@ -694,4 +694,12 @@ if [ $DUMP_RETVAL -ne 0 ]; then fi kdump_test_set_status "success" +#fence_kdump_send may fail to send a message due to slow network initialization. +#Let's wait for the network to be ready and retry. +if require_fence_message; then + get_host_ip + # Give fence_kdump_send a chance to send out message. + sleep 2 +fi + do_final_action diff --git a/kdump-lib-initramfs.sh b/kdump-lib-initramfs.sh index 6ab92ea4..7f04911b 100755 --- a/kdump-lib-initramfs.sh +++ b/kdump-lib-initramfs.sh @@ -112,6 +112,14 @@ get_mntpoint_from_target() echo $_mntpoint } +require_fence_message() +{ + if [ -n "$(kdump_get_conf_val fence_kdump_nodes)" ]; then + return 0 + fi + return 1 +} + is_ssh_dump_target() { kdump_get_conf_val ssh | grep -q @