From 26c1f5670ae5a2eb1e4ff02d9a82757a1c7d4f2e Mon Sep 17 00:00:00 2001 From: bixiaoyan Date: Fri, 25 Oct 2024 10:13:35 +0800 Subject: [PATCH] IPaddr2: add proto-parameter to be able to match a specific route podman: Improve handling of "stopping" container removal in remove_container() (cherry picked from commit 3e68de7607fe84da7d692a7acef15ce6b4221cc5) --- ...o-parameter-to-be-able-to-match-a-sp.patch | 60 +++++++++++++++++++ ...andling-of-stopping-container-remova.patch | 46 ++++++++++++++ resource-agents.spec | 8 ++- 3 files changed, 113 insertions(+), 1 deletion(-) create mode 100644 backport-IPaddr2-add-proto-parameter-to-be-able-to-match-a-sp.patch create mode 100644 backport-podman-Improve-handling-of-stopping-container-remova.patch diff --git a/backport-IPaddr2-add-proto-parameter-to-be-able-to-match-a-sp.patch b/backport-IPaddr2-add-proto-parameter-to-be-able-to-match-a-sp.patch new file mode 100644 index 0000000..9436e85 --- /dev/null +++ b/backport-IPaddr2-add-proto-parameter-to-be-able-to-match-a-sp.patch @@ -0,0 +1,60 @@ +From 3e36f7882cff1277a87ac5bee9a37d9c5363c982 Mon Sep 17 00:00:00 2001 +From: Oyvind Albrigtsen +Date: Wed, 18 Sep 2024 10:15:17 +0200 +Subject: [PATCH 06/11] IPaddr2: add proto-parameter to be able to match a + specific route + +Fixes #1976 +--- + heartbeat/IPaddr2 | 13 ++++++++++++- + 1 file changed, 12 insertions(+), 1 deletion(-) + +diff --git a/heartbeat/IPaddr2 b/heartbeat/IPaddr2 +index c53356a9..e325aa57 100755 +--- a/heartbeat/IPaddr2 ++++ b/heartbeat/IPaddr2 +@@ -72,8 +72,8 @@ + OCF_RESKEY_ip_default="" + OCF_RESKEY_cidr_netmask_default="" + OCF_RESKEY_broadcast_default="" ++OCF_RESKEY_proto_default="" + OCF_RESKEY_iflabel_default="" +-OCF_RESKEY_cidr_netmask_default="" + OCF_RESKEY_lvs_support_default=false + OCF_RESKEY_lvs_ipv6_addrlabel_default=true + OCF_RESKEY_lvs_ipv6_addrlabel_value_default=99 +@@ -96,6 +96,7 @@ OCF_RESKEY_network_namespace_default="" + : ${OCF_RESKEY_ip=${OCF_RESKEY_ip_default}} + : ${OCF_RESKEY_cidr_netmask=${OCF_RESKEY_cidr_netmask_default}} + : ${OCF_RESKEY_broadcast=${OCF_RESKEY_broadcast_default}} ++: ${OCF_RESKEY_proto=${OCF_RESKEY_proto_default}} + : ${OCF_RESKEY_iflabel=${OCF_RESKEY_iflabel_default}} + : ${OCF_RESKEY_lvs_support=${OCF_RESKEY_lvs_support_default}} + : ${OCF_RESKEY_lvs_ipv6_addrlabel=${OCF_RESKEY_lvs_ipv6_addrlabel_default}} +@@ -118,6 +119,8 @@ OCF_RESKEY_network_namespace_default="" + + ####################################################################### + ++[ -z "$OCF_RESKEY_proto" ] && proto="" || proto="proto $OCF_RESKEY_proto" ++ + SENDARP=$HA_BIN/send_arp + SENDUA=$HA_BIN/send_ua + FINDIF=findif +@@ -224,6 +227,14 @@ bits of the interface prefix. + + + ++ ++ ++Proto to match when finding network. E.g. "kernel". ++ ++Proto ++ ++ ++ + + + You can specify an additional label for your IP address here. +-- +2.25.1 + diff --git a/backport-podman-Improve-handling-of-stopping-container-remova.patch b/backport-podman-Improve-handling-of-stopping-container-remova.patch new file mode 100644 index 0000000..90dd9e6 --- /dev/null +++ b/backport-podman-Improve-handling-of-stopping-container-remova.patch @@ -0,0 +1,46 @@ +From e3ba7ba866d2d2cd7b1fe37a111445dc3c95182d Mon Sep 17 00:00:00 2001 +From: Antonio Romito +Date: Tue, 10 Sep 2024 14:39:14 +0200 +Subject: [PATCH 02/11] podman: Improve handling of "stopping" container + removal in remove_container() (#1973) + +- Added handling for containers in a stopping state by checking the state and force-removing if necessary. +- Improved log messages to provide clearer information when force removal is needed. + +Related: https://issues.redhat.com/browse/RHEL-58008 +--- + heartbeat/podman | 11 +++++++++-- + 1 file changed, 9 insertions(+), 2 deletions(-) + +diff --git a/heartbeat/podman b/heartbeat/podman +index 53867bff..643ec4d8 100755 +--- a/heartbeat/podman ++++ b/heartbeat/podman +@@ -254,6 +254,13 @@ remove_container() + ocf_run podman rm -v $CONTAINER + rc=$? + if [ $rc -ne 0 ]; then ++ if [ $rc -eq 2 ]; then ++ if podman inspect --format '{{.State.Status}}' $CONTAINER | grep -wq "stopping"; then ++ ocf_log err "Inactive container ${CONTAINER} is stuck in 'stopping' state. Force-remove it." ++ ocf_run podman rm -f $CONTAINER ++ rc=$? ++ fi ++ fi + # due to a podman bug (rhbz#1841485), sometimes a stopped + # container can still be associated with Exec sessions, in + # which case the "podman rm" has to be forced +@@ -517,8 +524,8 @@ podman_stop() + # but the associated container exit code is -1. If that's the case, + # assume there's no failure and continue with the rm as usual. + if [ $rc -eq 125 ] && \ +- podman inspect --format '{{.State.Status}}:{{.State.ExitCode}}' $CONTAINER | grep -wq "stopped:-1"; then +- ocf_log warn "Container ${CONTAINER} had an unexpected stop outcome. Trying to remove it anyway." ++ podman inspect --format '{{.State.Status}}:{{.State.ExitCode}}' $CONTAINER | grep -Eq '^(exited|stopped):-1$'; then ++ ocf_log err "Container ${CONTAINER} had an unexpected stop outcome. Trying to remove it anyway." + else + ocf_exit_reason "Failed to stop container, ${CONTAINER}, based on image, ${OCF_RESKEY_image}." + return $OCF_ERR_GENERIC +-- +2.25.1 + diff --git a/resource-agents.spec b/resource-agents.spec index a6ffe45..f1334d3 100644 --- a/resource-agents.spec +++ b/resource-agents.spec @@ -1,7 +1,7 @@ Name: resource-agents Summary: Open Source HA Reusable Cluster Resource Scripts Version: 4.15.1 -Release: 6 +Release: 7 License: GPLv2+ and LGPLv2+ URL: https://github.com/ClusterLabs/resource-agents Source0: https://github.com/ClusterLabs/resource-agents/archive/v%{version}.tar.gz @@ -16,6 +16,8 @@ Patch6: backport-docker-compose-use-docker-compose-when-not-using-o Patch7: backport-nfsserver-also-stop-rpc-statd-for-nfsv4_only-to-avoi.patch Patch8: backport-Filesystem-dont-sleep-during-stop-action-when-there-.patch Patch9: backport-powervs-subnet-Enable-access-via-private-endpoint-fo.patch +Patch10: backport-IPaddr2-add-proto-parameter-to-be-able-to-match-a-sp.patch +Patch11: backport-podman-Improve-handling-of-stopping-container-remova.patch Obsoletes: heartbeat-resources <= %{version} Provides: heartbeat-resources = %{version} @@ -114,6 +116,10 @@ export CFLAGS="$(echo '%{optflags}')" %{_mandir}/man8/{ocf-tester.8*,ldirectord.8*} %changelog +* Fri Oct 25 2024 bixiaoyan - 4.15.1-7 +- IPaddr2: add a check to make sure the label got applied +- podman: Improve handling of "stopping" container removal in remove_container() + * Thu Oct 24 2024 bizhiyuan - 4.15.1-6 - Filesystem: dont sleep during stop-action when there are no processes to kill - powervs-subnet: Enable access via private endpoint for IBM IAM -- Gitee