Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
openSUSE:Leap:15.6:Update
pacemaker
pacemaker#3304-0001-Fix-attrd-write-Pacemaker-R...
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File pacemaker#3304-0001-Fix-attrd-write-Pacemaker-Remote-node-attributes-eve.patch of Package pacemaker
From 238cd1697e59e1aef174b494eb89af265d0b08b9 Mon Sep 17 00:00:00 2001 From: Ken Gaillot <kgaillot@redhat.com> Date: Mon, 18 Dec 2023 10:08:30 -0600 Subject: [PATCH] Fix: attrd: write Pacemaker Remote node attributes even if not in cache Previously, we required a node to be in one of the node caches in order to write out its attributes. However for Pacemaker Remote nodes, we only need the node name to do the write, and we already have that even if it's not cached. --- daemons/attrd/attrd_cib.c | 55 +++++++++++++++++++++------------------ 1 file changed, 30 insertions(+), 25 deletions(-) Index: pacemaker-2.1.7+20231219.0f7f88312/daemons/attrd/attrd_cib.c =================================================================== --- pacemaker-2.1.7+20231219.0f7f88312.orig/daemons/attrd/attrd_cib.c +++ pacemaker-2.1.7+20231219.0f7f88312/daemons/attrd/attrd_cib.c @@ -20,6 +20,7 @@ #include <crm/common/results.h> #include <crm/common/strings_internal.h> #include <crm/common/xml.h> +#include <crm/cluster/internal.h> // pcmk__get_peer_full() #include "pacemaker-attrd.h" @@ -543,20 +544,26 @@ write_attribute(attribute_t *a, bool ign /* Iterate over each peer value of this attribute */ g_hash_table_iter_init(&iter, a->values); while (g_hash_table_iter_next(&iter, NULL, (gpointer *) &v)) { - crm_node_t *peer = crm_get_peer_full(v->nodeid, v->nodename, - CRM_GET_PEER_ANY); + const char *uuid = NULL; - /* If the value's peer info does not correspond to a peer, ignore it */ - if (peer == NULL) { - crm_notice("Cannot update %s[%s]=%s because peer not known", - a->id, v->nodename, v->current); - continue; - } + if (v->is_remote) { + /* If this is a Pacemaker Remote node, the node's UUID is the same + * as its name, which we already have. + */ + uuid = v->nodename; - /* If we're just learning the peer's node id, remember it */ - if (peer->id && (v->nodeid == 0)) { - crm_trace("Learned ID %u for node %s", peer->id, v->nodename); - v->nodeid = peer->id; + } else { + // This will create a cluster node cache entry if none exists + crm_node_t *peer = pcmk__get_peer_full(v->nodeid, v->nodename, NULL, + CRM_GET_PEER_ANY); + + uuid = peer->uuid; + + // Remember peer's node ID if we're just now learning it + if ((peer->id != 0) && (v->nodeid == 0)) { + crm_trace("Learned ID %u for node %s", peer->id, v->nodename); + v->nodeid = peer->id; + } } /* If this is a private attribute, no update needs to be sent */ @@ -565,29 +572,27 @@ write_attribute(attribute_t *a, bool ign continue; } - /* If the peer is found, but its uuid is unknown, defer write */ - if (peer->uuid == NULL) { + // Defer write if this is a cluster node that's never been seen + if (uuid == NULL) { a->unknown_peer_uuids = true; - crm_notice("Cannot update %s[%s]=%s because peer UUID not known " - "(will retry if learned)", + crm_notice("Cannot update %s[%s]='%s' now because node's UUID is " + "unknown (will retry if learned)", a->id, v->nodename, v->current); continue; } // Update this value as part of the CIB transaction we're building - rc = add_attr_update(a, v->current, peer->uuid); + rc = add_attr_update(a, v->current, uuid); if (rc != pcmk_rc_ok) { - crm_err("Failed to update %s[%s]=%s (peer known as %s, UUID %s, " - "ID %" PRIu32 "/%" PRIu32 "): %s", - a->id, v->nodename, v->current, peer->uname, peer->uuid, - peer->id, v->nodeid, pcmk_rc_str(rc)); + crm_err("Failed to update %s[%s]='%s': %s " + CRM_XS " node uuid=%s id=%" PRIu32, + a->id, v->nodename, v->current, pcmk_rc_str(rc), + uuid, v->nodeid); continue; } - crm_debug("Updating %s[%s]=%s (peer known as %s, UUID %s, ID " - "%" PRIu32 "/%" PRIu32 ")", - a->id, v->nodename, v->current, - peer->uname, peer->uuid, peer->id, v->nodeid); + crm_debug("Updating %s[%s]=%s (node uuid=%s id=%" PRIu32 ")", + a->id, v->nodename, v->current, uuid, v->nodeid); cib_updates++; /* Preservation of the attribute to transmit alert */
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor