File bsc#1196673-0001-Feature-controller-record-CRM-feature-set-as-a-trans.patch of Package pacemaker.27546

From 7cdc76865be9dfe43fc0c47cff1085236b45cf1f Mon Sep 17 00:00:00 2001
From: Petr Pavlu <petr.pavlu@suse.com>
Date: Tue, 24 May 2022 18:02:30 +0200
Subject: [PATCH] Feature: controller: record CRM feature set as a transient
 attribute

Set a transient attribute with CRM feature set for each joined node to
allow to determine if all nodes are updated to the same version. This
information is intended to be queried by tools such as crm_mon or Hawk
which can then warn the user about running a mixed-version cluster.
---
 daemons/controld/controld_join_client.c | 4 ++++
 include/crm/crm.h                       | 3 ++-
 2 files changed, 6 insertions(+), 1 deletion(-)

Index: pacemaker-2.1.2+20211124.ada5c3b36/daemons/controld/controld_join_client.c
===================================================================
--- pacemaker-2.1.2+20211124.ada5c3b36.orig/daemons/controld/controld_join_client.c
+++ pacemaker-2.1.2+20211124.ada5c3b36/daemons/controld/controld_join_client.c
@@ -264,6 +264,10 @@ do_cl_join_finalize_respond(long long ac
 
     update_dc_expected(input->msg);
 
+    /* record the node's feature set as a transient attribute */
+    update_attrd(fsa_our_uname, CRM_ATTR_FEATURE_SET, CRM_FEATURE_SET, NULL,
+                 FALSE);
+
     /* send our status section to the DC */
     tmp1 = controld_query_executor_state(fsa_our_uname);
     if (tmp1 != NULL) {
Index: pacemaker-2.1.2+20211124.ada5c3b36/include/crm/crm.h
===================================================================
--- pacemaker-2.1.2+20211124.ada5c3b36.orig/include/crm/crm.h
+++ pacemaker-2.1.2+20211124.ada5c3b36/include/crm/crm.h
@@ -123,6 +123,7 @@ extern char *crm_system_name;
 #  define CRM_ATTR_DIGESTS_SECURE   "#digests-secure"
 #  define CRM_ATTR_RA_VERSION       "#ra-version"
 #  define CRM_ATTR_PROTOCOL         "#attrd-protocol"
+#  define CRM_ATTR_FEATURE_SET      "#feature-set"
 
 /* Valid operations */
 #  define CRM_OP_NOOP		"noop"
openSUSE Build Service is sponsored by