File bsc#1198767-0002-Fix-scheduler-Do-not-fence-a-pending-node-that-doesn.patch of Package pacemaker.34780

From 00dd1989fdad9ceafbc2e385d5171ddb18b1dda9 Mon Sep 17 00:00:00 2001
From: "Gao,Yan" <ygao@suse.com>
Date: Tue, 21 Feb 2023 17:08:11 +0100
Subject: [PATCH 2/3] Fix: scheduler: Do not fence a pending node that doesn't
 have an uname in node state yet

If a joining peer makes the cluster acquire the quorum from corosync
meanwhile it has not joined CPG membership of pacemaker-controld yet,
it's possible that the created node_state entry doesn't have an uname
yet. Previously in that case, the node would be considered `UNCLEAN
(offline)` and get unnecessarily fenced before it got a chance to join
CPG yet.

The fix resolves that by recognizing the node as `pending` and waiting
for it to join CPG.
---
 lib/pengine/unpack.c | 16 +++++++++++-----
 1 file changed, 11 insertions(+), 5 deletions(-)

Index: pacemaker-2.1.2+20211124.ada5c3b36/lib/pengine/unpack.c
===================================================================
--- pacemaker-2.1.2+20211124.ada5c3b36.orig/lib/pengine/unpack.c
+++ pacemaker-2.1.2+20211124.ada5c3b36/lib/pengine/unpack.c
@@ -1074,15 +1074,21 @@ unpack_node_state(xmlNode *state, pe_wor
 
     uname = crm_element_value(state, XML_ATTR_UNAME);
     if (uname == NULL) {
-        crm_warn("Ignoring malformed " XML_CIB_TAG_STATE " entry without "
-                 XML_ATTR_UNAME);
-        return;
+        /* If a joining peer makes the cluster acquire the quorum from corosync
+         * meanwhile it has not joined CPG membership of pacemaker-controld yet,
+         * it's possible that the created node_state entry doesn't have an uname
+         * yet. We should recognize the node as `pending` and wait for it to
+         * join CPG.
+         */
+        crm_trace("Handling " XML_CIB_TAG_STATE " entry with id=\"%s\" without "
+                  XML_ATTR_UNAME, id);
     }
 
     this_node = pe_find_node_any(data_set->nodes, id, uname);
     if (this_node == NULL) {
-        pcmk__config_warn("Ignoring recorded node state for '%s' because "
-                          "it is no longer in the configuration", uname);
+        pcmk__config_warn("Ignoring recorded node state for id=\"%s\" (%s) "
+                          "because it is no longer in the configuration",
+                          id, crm_str(uname));
         return;
     }
 
openSUSE Build Service is sponsored by