Blame SOURCES/014-abort-transition.patch

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