Rebase pacemaker on upstream 2.1.5 final release

- Add support for sync points to attribute daemon
- Resolves: rhbz2122353
This commit is contained in:
Chris Lumens 2022-12-08 15:53:56 -05:00
parent 1e78757ca6
commit 72813a0b3b
4 changed files with 2438 additions and 129 deletions

View File

@ -1,125 +0,0 @@
From d4ab299aee5e4eb76c8fdd5b03813ade424e1413 Mon Sep 17 00:00:00 2001
From: Chris Lumens <clumens@redhat.com>
Date: Mon, 28 Nov 2022 08:07:58 -0500
Subject: [PATCH 1/3] Low: tests: s/xmllint_errfile/xmllint_outfile
---
cts/cts-cli.in | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/cts/cts-cli.in b/cts/cts-cli.in
index 10e70ec16..421a95408 100755
--- a/cts/cts-cli.in
+++ b/cts/cts-cli.in
@@ -2525,7 +2525,7 @@ done
rm -rf "${shadow_dir}"
rm -f "${test_assert_outfile}"
rm -f "${test_assert_errfile}"
-rm -f "${xmllint_errfile}"
+rm -f "${xmllint_outfile}"
failed=0
--
2.31.1
From 050afc17357190121aab692d04df01922dfe107f Mon Sep 17 00:00:00 2001
From: Chris Lumens <clumens@redhat.com>
Date: Mon, 28 Nov 2022 08:35:08 -0500
Subject: [PATCH 2/3] Low: daemons: Check for NULL in attrd_create_attribute.
---
daemons/attrd/attrd_attributes.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/daemons/attrd/attrd_attributes.c b/daemons/attrd/attrd_attributes.c
index e08908d55..f1da16a93 100644
--- a/daemons/attrd/attrd_attributes.c
+++ b/daemons/attrd/attrd_attributes.c
@@ -29,6 +29,8 @@ attrd_create_attribute(xmlNode *xml)
const char *value = crm_element_value(xml, PCMK__XA_ATTR_DAMPENING);
attribute_t *a = calloc(1, sizeof(attribute_t));
+ CRM_ASSERT(a != NULL);
+
a->id = crm_element_value_copy(xml, PCMK__XA_ATTR_NAME);
a->set = crm_element_value_copy(xml, PCMK__XA_ATTR_SET);
a->uuid = crm_element_value_copy(xml, PCMK__XA_ATTR_UUID);
--
2.31.1
From ff914815fe59f87473b45937c1152c1cc6f9e7bd Mon Sep 17 00:00:00 2001
From: Chris Lumens <clumens@redhat.com>
Date: Mon, 28 Nov 2022 08:35:27 -0500
Subject: [PATCH 3/3] Low: libs: Check for NULL in various functions.
These were found by covscan and have been marked as false positives for
a while, but I'm not sure that is totally the case.
---
lib/pacemaker/pcmk_sched_migration.c | 7 +++++--
lib/pengine/pe_notif.c | 19 ++++++++++++++-----
2 files changed, 19 insertions(+), 7 deletions(-)
diff --git a/lib/pacemaker/pcmk_sched_migration.c b/lib/pacemaker/pcmk_sched_migration.c
index 0e302d325..7e6ba8ef9 100644
--- a/lib/pacemaker/pcmk_sched_migration.c
+++ b/lib/pacemaker/pcmk_sched_migration.c
@@ -77,8 +77,11 @@ pcmk__create_migration_actions(pe_resource_t *rsc, const pe_node_t *current)
if (rsc->partial_migration_target == NULL) {
pe__set_action_flags(migrate_from, pe_action_migrate_runnable);
- pe__set_action_flags(migrate_to, pe_action_migrate_runnable);
- migrate_to->needs = start->needs;
+
+ if (migrate_to != NULL) {
+ pe__set_action_flags(migrate_to, pe_action_migrate_runnable);
+ migrate_to->needs = start->needs;
+ }
// Probe -> migrate_to -> migrate_from
pcmk__new_ordering(rsc, pcmk__op_key(rsc->id, RSC_STATUS, 0), NULL,
diff --git a/lib/pengine/pe_notif.c b/lib/pengine/pe_notif.c
index 4427358e0..3d090f118 100644
--- a/lib/pengine/pe_notif.c
+++ b/lib/pengine/pe_notif.c
@@ -366,6 +366,8 @@ new_post_notify_action(pe_resource_t *rsc, pe_node_t *node,
{
pe_action_t *notify = NULL;
+ CRM_ASSERT(n_data != NULL);
+
// Create the "post-" notify action for specified instance
notify = new_notify_action(rsc, node, n_data->post, n_data->post_done,
n_data);
@@ -534,6 +536,10 @@ collect_resource_data(pe_resource_t *rsc, bool activity, notify_data_t *n_data)
notify_entry_t *entry = NULL;
pe_node_t *node = NULL;
+ if (n_data == NULL) {
+ return;
+ }
+
if (n_data->allowed_nodes == NULL) {
n_data->allowed_nodes = rsc->allowed_nodes;
}
@@ -975,9 +981,12 @@ pe__order_notifs_after_fencing(pe_action_t *stop, pe_resource_t *rsc,
crm_info("Ordering notifications for implied %s after fencing", stop->uuid);
n_data = pe__clone_notif_pseudo_ops(rsc, RSC_STOP, NULL, stonith_op);
- collect_resource_data(rsc, false, n_data);
- add_notify_env(n_data, "notify_stop_resource", rsc->id);
- add_notify_env(n_data, "notify_stop_uname", stop->node->details->uname);
- create_notify_actions(uber_parent(rsc), n_data);
- pe__free_notification_data(n_data);
+
+ if (n_data != NULL) {
+ collect_resource_data(rsc, false, n_data);
+ add_notify_env(n_data, "notify_stop_resource", rsc->id);
+ add_notify_env(n_data, "notify_stop_uname", stop->node->details->uname);
+ create_notify_actions(uber_parent(rsc), n_data);
+ pe__free_notification_data(n_data);
+ }
}
--
2.31.1

2429
001-sync-points.patch Normal file

File diff suppressed because it is too large Load Diff

View File

@ -36,10 +36,10 @@
## can be incremented to build packages reliably considered "newer"
## than previously built packages with the same pcmkversion)
%global pcmkversion 2.1.5
%global specversion 3
%global specversion 4
## Upstream commit (full commit ID, abbreviated commit ID, or tag) to build
%global commit 631339ca5aa334d69906a932abb2b6886ede7cd0
%global commit a3f44794f94e1571c6ba0042915ade369b4ce4b1
## Since git v2.11, the extent of abbreviation is autoscaled by default
## (used to be constant of 7), so we need to convey it for non-tags, too.
@ -248,7 +248,7 @@ Source0: https://codeload.github.com/%{github_owner}/%{name}/tar.gz/%{arch
Source1: https://codeload.github.com/%{github_owner}/%{nagios_name}/tar.gz/%{nagios_archive_github_url}
# upstream commits
Patch001: 001-covscan.patch
Patch001: 001-sync-points.patch
Requires: resource-agents
Requires: %{pkgname_pcmk_libs}%{?_isa} = %{version}-%{release}
@ -851,6 +851,11 @@ exit 0
%license %{nagios_name}-%{nagios_hash}/COPYING
%changelog
* Mon Dec 12 2022 Chris Lumens <clumens@redhat.com> - 2.1.5-4
- Rebase pacemaker on upstream 2.1.5 final release
- Add support for sync points to attribute daemon
- Resolves: rhbz2122353
* Tue Dec 06 2022 Chris Lumens <clumens@redhat.com> - 2.1.5-3
- Fix errors found by covscan
- Related: rhbz2122353

View File

@ -1,2 +1,2 @@
SHA512 (nagios-agents-metadata-105ab8a7b2c16b9a29cf1c1596b80136eeef332b.tar.gz) = 11ddeb48a4929e7642b6dfa9c7962aa1d7a1af1c569830f55ed6cd6773abac13377317327bc1db8411c8077884f83f81cc54d746c834b63a99fa6dc219b5caad
SHA512 (pacemaker-631339ca5.tar.gz) = 19994c3a6b232f1439efad966efe2885f548311437dc59de544bfc6519876b32bb31838a00e1a11c842eb9098784058d4bc2b298ba7a1a5b0e3270098a28853b
SHA512 (pacemaker-a3f44794f.tar.gz) = 554f4c47fcf2f5be61afe9b1485a6bb19de1bdfc0ec8d9be44eba31d77d0df1c6f07b29590299c4664e676a5c90e9c5fdb8a84921665151211df92d8f549dbc9