Blame SOURCES/014-abort-transition.patch

46037d
From 04d1ba5ff20e135c900239f0ebadad42a41b5eba Mon Sep 17 00:00:00 2001
46037d
From: Reid Wahl <nrwahl@protonmail.com>
46037d
Date: Sat, 10 Sep 2022 03:39:12 -0700
46037d
Subject: [PATCH] Fix: controller: Resource reordering doesn't cause transition
46037d
 abort
46037d
46037d
The te_update_diff_v2() function ignores all move operations. This is
46037d
correct for most CIB sections. However, a move in the resources section
46037d
affects placement order and can require resources to change nodes. In
46037d
that case, since the diff handler does not cause a transition abort, the
46037d
moves will not be initiated until the next natural transition (up to the
46037d
value of cluster-recheck-interval).
46037d
46037d
This commit modifies te_update_diff_v2() so that it no longer ignores
46037d
moves within the resources section.
46037d
46037d
This fixes a regression triggered by 41d0a1a and set up by 45e5e82.
46037d
However, the underlying bug had already been present. Prior to 41d0a1a,
46037d
the CIB replacement notification handler caused a transition abort, when
46037d
the resources section was replaced, which hid this bug.
46037d
46037d
Closes T549
46037d
46037d
Signed-off-by: Reid Wahl <nrwahl@protonmail.com>
46037d
---
46037d
 daemons/controld/controld_te_callbacks.c | 10 ++++++++--
46037d
 1 file changed, 8 insertions(+), 2 deletions(-)
46037d
46037d
diff --git a/daemons/controld/controld_te_callbacks.c b/daemons/controld/controld_te_callbacks.c
46037d
index 6e0dd216e..87ad861a2 100644
46037d
--- a/daemons/controld/controld_te_callbacks.c
46037d
+++ b/daemons/controld/controld_te_callbacks.c
46037d
@@ -419,7 +419,13 @@ te_update_diff_v2(xmlNode *diff)
46037d
             crm_trace("Ignoring %s change for version field", op);
46037d
             continue;
46037d
 
46037d
-        } else if (strcmp(op, "move") == 0) {
46037d
+        } else if ((strcmp(op, "move") == 0)
46037d
+                   && (strstr(xpath,
46037d
+                              "/" XML_TAG_CIB "/" XML_CIB_TAG_CONFIGURATION
46037d
+                              "/" XML_CIB_TAG_RESOURCES) == NULL)) {
46037d
+            /* We still need to consider moves within the resources section,
46037d
+             * since they affect placement order.
46037d
+             */
46037d
             crm_trace("Ignoring move change at %s", xpath);
46037d
             continue;
46037d
         }
46037d
@@ -434,7 +440,7 @@ te_update_diff_v2(xmlNode *diff)
46037d
                 match = match->children;
46037d
             }
46037d
 
46037d
-        } else if (strcmp(op, "delete") != 0) {
46037d
+        } else if (!pcmk__str_any_of(op, "delete", "move", NULL)) {
46037d
             crm_warn("Ignoring malformed CIB update (%s operation on %s is unrecognized)",
46037d
                      op, xpath);
46037d
             continue;
46037d
-- 
46037d
2.31.1
46037d