From e42874cbc3caa72f39140f62f6784b204f97c19c Mon Sep 17 00:00:00 2001 From: MSVSphere Packaging Team Date: Thu, 11 Jan 2024 03:14:44 +0300 Subject: [PATCH] import pacemaker-2.1.6-9.1.el8_9 --- SOURCES/010-revert-58400e27.patch | 62 +++++++++++++++++++++++++++++++ SOURCES/011-revert-f5263c94.patch | 34 +++++++++++++++++ SPECS/pacemaker.spec | 14 ++++++- 3 files changed, 108 insertions(+), 2 deletions(-) create mode 100644 SOURCES/010-revert-58400e27.patch create mode 100644 SOURCES/011-revert-f5263c94.patch diff --git a/SOURCES/010-revert-58400e27.patch b/SOURCES/010-revert-58400e27.patch new file mode 100644 index 0000000..d08ff17 --- /dev/null +++ b/SOURCES/010-revert-58400e27.patch @@ -0,0 +1,62 @@ +From 2e81e0db9a716c486805e0760f78be65ca79eeae Mon Sep 17 00:00:00 2001 +From: Ken Gaillot +Date: Tue, 17 Oct 2023 15:28:27 -0500 +Subject: [PATCH] Fix: attrd: avoid regression by reverting 58400e27 + +Fixes T714 +--- + daemons/attrd/attrd_cib.c | 5 ----- + daemons/attrd/attrd_elections.c | 10 +--------- + daemons/attrd/pacemaker-attrd.h | 1 - + 3 files changed, 1 insertion(+), 15 deletions(-) + +diff --git a/daemons/attrd/attrd_cib.c b/daemons/attrd/attrd_cib.c +index 2de37a7cb6..9ce2872715 100644 +--- a/daemons/attrd/attrd_cib.c ++++ b/daemons/attrd/attrd_cib.c +@@ -641,11 +641,6 @@ attrd_write_attributes(uint32_t options) + pcmk_is_set(options, attrd_write_all)? "all" : "changed"); + g_hash_table_iter_init(&iter, attributes); + while (g_hash_table_iter_next(&iter, NULL, (gpointer *) & a)) { +- if (pcmk_is_set(options, attrd_write_skip_shutdown) +- && pcmk__str_eq(a->id, XML_CIB_ATTR_SHUTDOWN, pcmk__str_none)) { +- continue; +- } +- + if (!pcmk_is_set(options, attrd_write_all) && a->unknown_peer_uuids) { + // Try writing this attribute again, in case peer ID was learned + a->changed = true; +diff --git a/daemons/attrd/attrd_elections.c b/daemons/attrd/attrd_elections.c +index a95cd44cbd..62310ed1d8 100644 +--- a/daemons/attrd/attrd_elections.c ++++ b/daemons/attrd/attrd_elections.c +@@ -35,16 +35,8 @@ attrd_election_cb(gpointer user_data) + + /* After winning an election, update the CIB with the values of all + * attributes as the winner knows them. +- * +- * However, do not write out any "shutdown" attributes. A node that is +- * shutting down will have all its transient attributes removed from the CIB +- * when its controller exits, and from the attribute manager's memory (on +- * remaining nodes) when its attribute manager exits; if an election is won +- * between when those two things happen, we don't want to write the shutdown +- * attribute back out, which would cause the node to immediately shut down +- * the next time it rejoins. + */ +- attrd_write_attributes(attrd_write_all|attrd_write_skip_shutdown); ++ attrd_write_attributes(attrd_write_all); + return G_SOURCE_REMOVE; + } + +diff --git a/daemons/attrd/pacemaker-attrd.h b/daemons/attrd/pacemaker-attrd.h +index e3c369b5bc..a95bb54367 100644 +--- a/daemons/attrd/pacemaker-attrd.h ++++ b/daemons/attrd/pacemaker-attrd.h +@@ -181,7 +181,6 @@ enum attrd_write_options { + attrd_write_changed = 0, + attrd_write_all = (1 << 0), + attrd_write_no_delay = (1 << 1), +- attrd_write_skip_shutdown = (1 << 2), + }; + + void attrd_write_attribute(attribute_t *a, bool ignore_delay); diff --git a/SOURCES/011-revert-f5263c94.patch b/SOURCES/011-revert-f5263c94.patch new file mode 100644 index 0000000..c0f1c03 --- /dev/null +++ b/SOURCES/011-revert-f5263c94.patch @@ -0,0 +1,34 @@ +From 14b87a38786ae5b4dc12fc1581e5d39a274fced2 Mon Sep 17 00:00:00 2001 +From: Ken Gaillot +Date: Mon, 30 Oct 2023 12:21:24 -0500 +Subject: [PATCH] Fix: attrd: revert faulty T138 fix + +f5263c9401 created a timing issue where a node could get a shutdown attribute, +the original writer leaves the cluster before writing it out, then the +shutting-down node wins the writer election. In that case, it would skip the +write-out and the scheduler would never shut it down. + +Reopens T138 +--- + daemons/attrd/attrd_elections.c | 8 -------- + 1 file changed, 8 deletions(-) + +diff --git a/daemons/attrd/attrd_elections.c b/daemons/attrd/attrd_elections.c +index 62310ed1d8..82fbe8affc 100644 +--- a/daemons/attrd/attrd_elections.c ++++ b/daemons/attrd/attrd_elections.c +@@ -22,14 +22,6 @@ + { + attrd_declare_winner(); + +- if (attrd_requesting_shutdown() || attrd_shutting_down()) { +- /* This node is shutting down or about to, meaning its attributes will +- * be removed (and may have already been removed from the CIB by a +- * controller). Don't sync or write its attributes in this case. +- */ +- return G_SOURCE_REMOVE; +- } +- + /* Update the peers after an election */ + attrd_peer_sync(NULL, NULL); + diff --git a/SPECS/pacemaker.spec b/SPECS/pacemaker.spec index 01608e7..d667fb1 100644 --- a/SPECS/pacemaker.spec +++ b/SPECS/pacemaker.spec @@ -36,7 +36,7 @@ ## can be incremented to build packages reliably considered "newer" ## than previously built packages with the same pcmkversion) %global pcmkversion 2.1.6 -%global specversion 8 +%global specversion 9 ## Upstream commit (full commit ID, abbreviated commit ID, or tag) to build %global commit 6fdc9deea294bbad629b003c6ae036aaed8e3ee0 @@ -242,7 +242,7 @@ Name: pacemaker Summary: Scalable High-Availability cluster resource manager Version: %{pcmkversion} -Release: %{pcmk_release}%{?dist} +Release: %{pcmk_release}.1%{?dist} %if %{defined _unitdir} License: GPL-2.0-or-later AND LGPL-2.1-or-later %else @@ -272,6 +272,8 @@ Patch006: 006-controller-reply.patch Patch007: 007-glib-assertions.patch Patch008: 008-attrd-shutdown.patch Patch009: 009-attrd-shutdown-2.patch +Patch010: 010-revert-58400e27.patch +Patch011: 011-revert-f5263c94.patch # downstream-only commits #Patch1xx: 1xx-xxxx.patch @@ -1010,6 +1012,14 @@ exit 0 %license %{nagios_name}-%{nagios_hash}/COPYING %changelog +* Tue Oct 31 2023 Chris Lumens - 2.1.6-9.1 +- Revert the rest of the attrd shutdown race condition fix +- Related: RHEL-14052 + +* Mon Oct 23 2023 Chris Lumens - 2.1.6-9 +- Avoid an error if the elected attrd is on a node that is shutting down +- Resolves: RHEL-14052 + * Tue Aug 29 2023 Chris Lumens - 2.1.6-8 - Fix an additional shutdown race between attrd and the controller - Related: rhbz2228955