diff --git a/Fix-libcrmcommon-wait-for-reply-from-appropriate-con.patch b/Fix-libcrmcommon-wait-for-reply-from-appropriate-con.patch new file mode 100644 index 0000000000000000000000000000000000000000..6189dbd610b332c56a6c8a5df28f3b4b13653c6e --- /dev/null +++ b/Fix-libcrmcommon-wait-for-reply-from-appropriate-con.patch @@ -0,0 +1,95 @@ +From b2cc5110fa35ed8010412391c9bf7673a25cf2ae Mon Sep 17 00:00:00 2001 +From: rpm-build +Date: Fri, 25 Aug 2023 15:29:09 +0800 +Subject: [PATCH] Fix: libcrmcommon: wait for reply from appropriate controller + commands + +--- + lib/common/ipc_controld.c | 49 ++++++++++++++------------------------- + 1 file changed, 17 insertions(+), 32 deletions(-) + +diff --git a/lib/common/ipc_controld.c b/lib/common/ipc_controld.c +index 9303afd..993a7b5 100644 +--- a/lib/common/ipc_controld.c ++++ b/lib/common/ipc_controld.c +@@ -177,18 +177,16 @@ set_nodes_data(pcmk_controld_api_reply_t *data, xmlNode *msg_data) + static bool + reply_expected(pcmk_ipc_api_t *api, xmlNode *request) + { +- const char *command = crm_element_value(request, F_CRM_TASK); +- +- if (command == NULL) { +- return false; +- } +- +- // We only need to handle commands that functions in this file can send +- return !strcmp(command, CRM_OP_REPROBE) +- || !strcmp(command, CRM_OP_NODE_INFO) +- || !strcmp(command, CRM_OP_PING) +- || !strcmp(command, CRM_OP_LRM_FAIL) +- || !strcmp(command, CRM_OP_LRM_DELETE); ++ // We only need to handle commands that API functions can send ++ return pcmk__str_any_of(crm_element_value(request, F_CRM_TASK), ++ PCMK__CONTROLD_CMD_NODES, ++ CRM_OP_LRM_DELETE, ++ CRM_OP_LRM_FAIL, ++ CRM_OP_NODE_INFO, ++ CRM_OP_PING, ++ CRM_OP_REPROBE, ++ CRM_OP_RM_NODE_CACHE, ++ NULL); + } + + static bool +@@ -202,22 +200,12 @@ dispatch(pcmk_ipc_api_t *api, xmlNode *reply) + pcmk_controld_reply_unknown, NULL, NULL, + }; + +- /* If we got an ACK, return true so the caller knows to expect more responses +- * from the IPC server. We do this before decrementing replies_expected because +- * ACKs are not going to be included in that value. +- * +- * Note that we cannot do the same kind of status checking here that we do in +- * ipc_pacemakerd.c. The ACK message we receive does not necessarily contain +- * a status attribute. That is, we may receive this: +- * +- * +- * +- * Instead of this: +- * +- * +- */ + if (pcmk__str_eq(crm_element_name(reply), "ack", pcmk__str_none)) { +- return true; // More replies needed ++ /* ACKs are trivial responses that do not count toward expected replies, ++ * and do not have all the fields that validation requires, so skip that ++ * processing. ++ */ ++ return private->replies_expected > 0; + } + + if (private->replies_expected > 0) { +@@ -344,18 +332,15 @@ static int + send_controller_request(pcmk_ipc_api_t *api, xmlNode *request, + bool reply_is_expected) + { +- int rc; +- + if (crm_element_value(request, XML_ATTR_REFERENCE) == NULL) { + return EINVAL; + } +- rc = pcmk__send_ipc_request(api, request); +- if ((rc == pcmk_rc_ok) && reply_is_expected) { ++ if (reply_is_expected) { + struct controld_api_private_s *private = api->api_data; + + private->replies_expected++; + } +- return rc; ++ return pcmk__send_ipc_request(api, request); + } + + static xmlNode * +-- +2.33.0 + diff --git a/pacemaker.spec b/pacemaker.spec index c487adfaabb53ad46766135215c30753bb9a7549..7c06e115694ec98b43012b81449780b0aad2ac53 100644 --- a/pacemaker.spec +++ b/pacemaker.spec @@ -17,7 +17,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 4 +%global specversion 5 ## Upstream commit (full commit ID, abbreviated commit ID, or tag) to build %global commit 6fdc9deea294bbad629b003c6ae036aaed8e3ee0 @@ -154,6 +154,7 @@ Source1: https://codeload.github.com/%{github_owner}/%{nagios_name}/tar.gz Patch0: 0001-Fix-glib-assertions.patch Patch1: 0001-Add-the-parameter-of-dampening-and-fix-attrd_updater.patch Patch2: 0001-Add-the-parameter-of-dampening-and-fix-attrd_updater-HealthIOWait.patch +Patch3: Fix-libcrmcommon-wait-for-reply-from-appropriate-con.patch # upstream commits @@ -774,6 +775,9 @@ exit 0 %license %{nagios_name}-%{nagios_hash}/COPYING %changelog +* Fri Aug 25 2023 zhanghan - 2.1.6-5 +- Fix: libcrmcommon: wait for reply from appropriate controller commands + * Wed Aug 23 2023 liupei - 2.1.6-4 - Add the parameter of attrd_delay and fix attrd_updter command for HealthIOWait