2.0.1-0.3.rc4 - Update for new upstream tarball
...for release candidate: Pacemaker-2.0.1-rc4, for full details, see included ChangeLog file or https://github.com/ClusterLabs/pacemaker/releases/tag/Pacemaker-2.0.1-rc4 Conditionally disable "hash affected tests" in cts-scheduler (-cts package), since it is unlikely glib v2.59.0+ present in the buildroot will be artificially downgraded post-deployment Signed-off-by: Jan Pokorný <jpokorny@redhat.com>
This commit is contained in:
parent
2e9dd7fbd9
commit
61057ce357
@ -1,69 +0,0 @@
|
||||
From abb6feeb39c027aa0c3f973ef93e3524ea866936 Mon Sep 17 00:00:00 2001
|
||||
From: Klaus Wenninger <klaus.wenninger@aon.at>
|
||||
Date: Mon, 21 Jan 2019 13:40:44 +0100
|
||||
Subject: [PATCH] Fix: crm_mon: remove duplicity of fence-action-state in
|
||||
xml-output
|
||||
|
||||
and unnecessary conditionals making code less readable that were
|
||||
probably introduced rearranging the code.
|
||||
|
||||
rhbz#1667191
|
||||
---
|
||||
tools/crm_mon.c | 16 +++++-----------
|
||||
1 file changed, 5 insertions(+), 11 deletions(-)
|
||||
|
||||
diff --git a/tools/crm_mon.c b/tools/crm_mon.c
|
||||
index aad9b719b4..bc161aac33 100644
|
||||
--- a/tools/crm_mon.c
|
||||
+++ b/tools/crm_mon.c
|
||||
@@ -3175,7 +3175,7 @@ print_stonith_action(FILE *stream, stonith_history_t *event)
|
||||
fprintf(stream, " completed=\"%s\"", run_at_s?run_at_s:"");
|
||||
break;
|
||||
default:
|
||||
- fprintf(stream, " state=\"pending\"");
|
||||
+ break;
|
||||
}
|
||||
fprintf(stream, " />\n");
|
||||
break;
|
||||
@@ -3189,8 +3189,7 @@ print_stonith_action(FILE *stream, stonith_history_t *event)
|
||||
action_s, event->target,
|
||||
event->delegate ? event->delegate : "",
|
||||
event->client, event->origin,
|
||||
- ((!fence_full_history) && (output_format != mon_output_xml))?
|
||||
- "last-successful":"completed",
|
||||
+ fence_full_history?"completed":"last-successful",
|
||||
run_at_s?run_at_s:"");
|
||||
break;
|
||||
case st_failed:
|
||||
@@ -3199,8 +3198,7 @@ print_stonith_action(FILE *stream, stonith_history_t *event)
|
||||
action_s, event->target,
|
||||
event->delegate ? event->delegate : "",
|
||||
event->client, event->origin,
|
||||
- ((!fence_full_history) && (output_format != mon_output_xml))?
|
||||
- "last-failed":"completed",
|
||||
+ fence_full_history?"completed":"last-failed",
|
||||
run_at_s?run_at_s:"");
|
||||
break;
|
||||
default:
|
||||
@@ -3219,9 +3217,7 @@ print_stonith_action(FILE *stream, stonith_history_t *event)
|
||||
action_s, event->target,
|
||||
event->delegate ? event->delegate : "",
|
||||
event->client, event->origin,
|
||||
- ((!fence_full_history) &&
|
||||
- (output_format != mon_output_xml))?
|
||||
- "last-successful":"completed",
|
||||
+ fence_full_history?"completed":"last-successful",
|
||||
run_at_s?run_at_s:"");
|
||||
break;
|
||||
case st_failed:
|
||||
@@ -3230,9 +3226,7 @@ print_stonith_action(FILE *stream, stonith_history_t *event)
|
||||
action_s, event->target,
|
||||
event->delegate ? event->delegate : "",
|
||||
event->client, event->origin,
|
||||
- ((!fence_full_history) &&
|
||||
- (output_format != mon_output_xml))?
|
||||
- "last-failed":"completed",
|
||||
+ fence_full_history?"completed":"last-failed",
|
||||
run_at_s?run_at_s:"");
|
||||
break;
|
||||
default:
|
||||
@ -1,66 +0,0 @@
|
||||
From 286569c1a2359a97ad33f77b3b6b63b04d520b76 Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Jan=20Pokorn=C3=BD?= <jpokorny@redhat.com>
|
||||
Date: Sat, 19 Jan 2019 22:18:37 +0100
|
||||
Subject: [PATCH] Revert "Tests: cts-cli: Use extended regular expressions."
|
||||
|
||||
This reverts commit 48f59e65223e018f4a639c4c9c155cb62e7806a9, because
|
||||
while it's true that GNU sed supports -E switch _now_, it wasn't the
|
||||
case until about v4.1.5+ (silently, see 3a8e165, and explicitly since
|
||||
v4.3, see 8b65e07), meaning that, for instance, RHEL 7 doesn't
|
||||
officially supports it (as sad as it is):
|
||||
https://bugzilla.redhat.com/show_bug.cgi?id=1564789
|
||||
|
||||
Also note that while there was an effort to standardize -E switch
|
||||
in POSIX (http://austingroupbugs.net/view.php?id=528) it may have passed
|
||||
without any affect so far (speaking of "2018 edition"):
|
||||
https://pubs.opengroup.org/onlinepubs/9699919799/utilities/sed.html
|
||||
Definitely, it wasn't in IEEE Std 1003.1-2008 that, moreover, we don't
|
||||
take for granted even 10+ years later (cf. ongoing parallel discussion
|
||||
whether and how to check for %m specifier to scanf(3)), the change at
|
||||
hand is not anything else but invalid. Also, -E implementation may
|
||||
have been faulty until sed v4.5:
|
||||
https://lists.gnu.org/archive/html/info-gnu/2018-04/msg00000.html
|
||||
|
||||
Note that one can make do without extended regular expressions, and in
|
||||
turn, without '+' (or '\+' that is just a GNU-specific extension into
|
||||
basic regular expressions syntax), since the respective substitute
|
||||
can be used: "a+" ~ "aa*" (can be hefty for long patterns, but that's
|
||||
what we reliably have).
|
||||
---
|
||||
cts/cts-cli.in | 15 +++++++--------
|
||||
1 file changed, 7 insertions(+), 8 deletions(-)
|
||||
|
||||
diff --git a/cts/cts-cli.in b/cts/cts-cli.in
|
||||
index e48d644574..34c094e76c 100755
|
||||
--- a/cts/cts-cli.in
|
||||
+++ b/cts/cts-cli.in
|
||||
@@ -924,22 +924,21 @@ for t in $tests; do
|
||||
eval TMPFILE_$t="$TMPFILE"
|
||||
test_$t > "$TMPFILE"
|
||||
|
||||
- sed -E \
|
||||
- -e 's/cib-last-written.*>/>/'\
|
||||
+ sed -e 's/cib-last-written.*>/>/'\
|
||||
-e 's/ last-run=\"[0-9]*\"//'\
|
||||
-e 's/crm_feature_set="[^"]*" //'\
|
||||
-e 's/validate-with="[^"]*" //'\
|
||||
-e 's/Created new pacemaker-.* configuration/Created new pacemaker configuration/'\
|
||||
- -e 's/.*(pcmk__.*)@.*.c:[0-9][0-9]*\)/\1/g' \
|
||||
- -e 's/.*(unpack_.*)@.*.c:[0-9][0-9]*\)/\1/g' \
|
||||
- -e 's/.*(update_validation)@.*\.c:[0-9][0-9]*\)/\1/g' \
|
||||
- -e 's/.*(apply_upgrade)@.*\.c:[0-9][0-9]*\)/\1/g' \
|
||||
+ -e 's/.*\(pcmk__.*\)@.*\.c:[0-9][0-9]*)/\1/g' \
|
||||
+ -e 's/.*\(unpack_.*\)@.*\.c:[0-9][0-9]*)/\1/g' \
|
||||
+ -e 's/.*\(update_validation\)@.*\.c:[0-9][0-9]*)/\1/g' \
|
||||
+ -e 's/.*\(apply_upgrade\)@.*\.c:[0-9][0-9]*)/\1/g' \
|
||||
-e 's/ last-rc-change=\"[0-9]*\"//'\
|
||||
-e 's|^/tmp/cts-cli\.validity\.bad.xml\.[^:]*:|validity.bad.xml:|'\
|
||||
-e 's/^Entity: line [0-9][0-9]*: //'\
|
||||
- -e 's/(validation \([0-9][0-9]* of )[0-9][0-9]*(\).*)/\1X\2/' \
|
||||
+ -e 's/\(validation ([0-9][0-9]* of \)[0-9][0-9]*\().*\)/\1X\2/' \
|
||||
-e 's/^Migration will take effect until: .*/Migration will take effect until:/' \
|
||||
- -e 's/ end=\"[-: 0123456789]+Z?\"/ end=\"\"/' \
|
||||
+ -e 's/ end=\"[-: 0123456789]*Z\?\"/ end=\"\"/' \
|
||||
"$TMPFILE" > "${TMPFILE}.$$"
|
||||
mv -- "${TMPFILE}.$$" "$TMPFILE"
|
||||
|
||||
@ -1,27 +0,0 @@
|
||||
From 86ba5e63eff051aa01b4872cee97896aecf38ef9 Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Jan=20Pokorn=C3=BD?= <jpokorny@redhat.com>
|
||||
Date: Sat, 19 Jan 2019 23:17:11 +0100
|
||||
Subject: [PATCH] Tests: cts-cli: simplify+fix regexp to catch
|
||||
crm_time_as_string's output
|
||||
|
||||
Previously, the cts-cli would only work with a zero-offset time zone
|
||||
(suggesting that it was only run in the CI that may be expected to
|
||||
have it like that). Also drop the atypical enumeration of all digits
|
||||
vs. range capture.
|
||||
---
|
||||
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 34c094e76c..093dbcfa3a 100755
|
||||
--- a/cts/cts-cli.in
|
||||
+++ b/cts/cts-cli.in
|
||||
@@ -938,7 +938,7 @@ for t in $tests; do
|
||||
-e 's/^Entity: line [0-9][0-9]*: //'\
|
||||
-e 's/\(validation ([0-9][0-9]* of \)[0-9][0-9]*\().*\)/\1X\2/' \
|
||||
-e 's/^Migration will take effect until: .*/Migration will take effect until:/' \
|
||||
- -e 's/ end=\"[-: 0123456789]*Z\?\"/ end=\"\"/' \
|
||||
+ -e 's/ end=\"[0-9][-+: 0-9]*Z\?\"/ end=\"\"/' \
|
||||
"$TMPFILE" > "${TMPFILE}.$$"
|
||||
mv -- "${TMPFILE}.$$" "$TMPFILE"
|
||||
|
||||
@ -1,86 +0,0 @@
|
||||
From a2e873635db3dfbb696527372dfaad9f58621f48 Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Jan=20Pokorn=C3=BD?= <jpokorny@redhat.com>
|
||||
Date: Mon, 21 Jan 2019 20:46:56 +0100
|
||||
Subject: [PATCH] Build: 2 *.c: restore GCC 9 -Werror buildability: avoid NULL
|
||||
to '%s' arg
|
||||
|
||||
Sadly, pacemaker codebase seems to be possibly heavily spoiled with
|
||||
this undefined behaviour when possibly passing NULL corresponding to
|
||||
'%s' format specifier argument, so for the time being, fix just what
|
||||
new GCC 9 started to spot[*] (due to build-time constant NULLs, which
|
||||
is an immediate proof) since these occurrences boil down to mere
|
||||
thinkos. Related to that, would be wise to start rolling out
|
||||
nonnull annotations to preserve more general sanity in this self
|
||||
explanatory aspect.
|
||||
|
||||
Looking at libqb code (end destination of "crm_log" processing), there's
|
||||
nothing to implicitly mask NULL with a predestined string explicitly
|
||||
(like glibc make do with "(null)" in majority of the cases), so unless
|
||||
merely a blackbox is used for logging (qb_vsnprintf_serialize seems to
|
||||
deal with such a NULL gracefully), passing NULLs where a character array
|
||||
is expected is rather dangerous without the prior knowledge of
|
||||
particular libc (vsnprintf) implementation.
|
||||
|
||||
[*] https://gcc.gnu.org/git/?p=gcc.git;a=blobdiff;f=gcc/gimple-ssa-sprintf.c;h=456a7d400115713a6600b1ce7bb303b6c971550e;hb=7b2ced2fa2c0597ba083461864c9026c3c9d3720;hpb=b07bf3b9730bebfc9953ea2eeee86a1274e39022
|
||||
---
|
||||
daemons/based/based_callbacks.c | 6 +++---
|
||||
tools/test.iso8601.c | 11 ++++-------
|
||||
2 files changed, 7 insertions(+), 10 deletions(-)
|
||||
|
||||
diff --git a/daemons/based/based_callbacks.c b/daemons/based/based_callbacks.c
|
||||
index 723e74c876..daef8c7a63 100644
|
||||
--- a/daemons/based/based_callbacks.c
|
||||
+++ b/daemons/based/based_callbacks.c
|
||||
@@ -594,8 +594,8 @@ parse_peer_options_v1(int call_type, xmlNode * request,
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
- crm_trace("Processing %s request sent by %s", op, originator);
|
||||
op = crm_element_value(request, F_CIB_OPERATION);
|
||||
+ crm_trace("Processing %s request sent by %s", op, originator);
|
||||
if (safe_str_eq(op, "cib_shutdown_req")) {
|
||||
/* Always process these */
|
||||
*local_notify = FALSE;
|
||||
@@ -650,11 +650,11 @@ parse_peer_options_v1(int call_type, xmlNode * request,
|
||||
|
||||
} else if (safe_str_eq(op, "cib_shutdown_req")) {
|
||||
if (reply_to != NULL) {
|
||||
- crm_debug("Processing %s from %s", op, host);
|
||||
+ crm_debug("Processing %s from %s", op, originator);
|
||||
*needs_reply = FALSE;
|
||||
|
||||
} else {
|
||||
- crm_debug("Processing %s reply from %s", op, host);
|
||||
+ crm_debug("Processing %s reply from %s", op, originator);
|
||||
}
|
||||
return TRUE;
|
||||
|
||||
diff --git a/tools/test.iso8601.c b/tools/test.iso8601.c
|
||||
index 6d70af5a4c..93ca4814f6 100644
|
||||
--- a/tools/test.iso8601.c
|
||||
+++ b/tools/test.iso8601.c
|
||||
@@ -8,6 +8,7 @@
|
||||
#include <crm_internal.h>
|
||||
#include <crm/crm.h>
|
||||
#include <crm/common/iso8601.h>
|
||||
+#include <crm/common/util.h> /* CRM_ASSERT */
|
||||
#include <unistd.h>
|
||||
|
||||
char command = 0;
|
||||
@@ -46,13 +47,9 @@ static struct crm_option long_options[] = {
|
||||
static void
|
||||
log_time_period(int log_level, crm_time_period_t * dtp, int flags)
|
||||
{
|
||||
- char *end = NULL;
|
||||
- char *start = NULL;
|
||||
-
|
||||
- if(dtp) {
|
||||
- start = crm_time_as_string(dtp->start, flags);
|
||||
- end = crm_time_as_string(dtp->end, flags);
|
||||
- }
|
||||
+ char *start = crm_time_as_string(dtp->start, flags);
|
||||
+ char *end = crm_time_as_string(dtp->end, flags);
|
||||
+ CRM_ASSERT(start != NULL && end != NULL);
|
||||
|
||||
if (log_level < LOG_CRIT) {
|
||||
printf("Period: %s to %s\n", start, end);
|
||||
@ -1,46 +0,0 @@
|
||||
From 9dc14b55077567099a13b71ac87816f608b044a9 Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Jan=20Pokorn=C3=BD?= <jpokorny@redhat.com>
|
||||
Date: Wed, 15 Aug 2018 10:52:49 +0200
|
||||
Subject: [PATCH] Maint: cts: refrain from async (await) in Python code for
|
||||
being reserved
|
||||
|
||||
... as of Python 3.7:
|
||||
https://docs.python.org/3/whatsnew/3.7.html#summary-release-highlights
|
||||
|
||||
One of the instance attributes turned out to be bogus.
|
||||
|
||||
Randomly spotted; unfortunately byte compilation when building package
|
||||
for Fedora will not consider unability to pregenerate bytecode a fatal
|
||||
problem.
|
||||
---
|
||||
cts/remote.py | 1 -
|
||||
cts/watcher.py | 4 ++--
|
||||
2 files changed, 2 insertions(+), 3 deletions(-)
|
||||
|
||||
diff --git a/cts/remote.py b/cts/remote.py
|
||||
index af18d410c6..e5e4c276a2 100644
|
||||
--- a/cts/remote.py
|
||||
+++ b/cts/remote.py
|
||||
@@ -140,7 +140,6 @@ class uses ssh.
|
||||
'''
|
||||
|
||||
def __init__(self, rsh, silent=False):
|
||||
- self.async = []
|
||||
self.rsh = rsh
|
||||
self.silent = silent
|
||||
self.logger = LogFactory()
|
||||
diff --git a/cts/watcher.py b/cts/watcher.py
|
||||
index f3ca5806ee..56239eaf8b 100644
|
||||
--- a/cts/watcher.py
|
||||
+++ b/cts/watcher.py
|
||||
@@ -47,8 +47,8 @@ def debug(self, args):
|
||||
self.logger.debug(message)
|
||||
|
||||
def harvest(self, delegate=None):
|
||||
- async = self.harvest_async(delegate)
|
||||
- async.join()
|
||||
+ async_task = self.harvest_async(delegate)
|
||||
+ async_task.join()
|
||||
|
||||
def harvest_async(self, delegate=None):
|
||||
self.log("Not implemented")
|
||||
@ -14,11 +14,11 @@
|
||||
## can be incremented to build packages reliably considered "newer"
|
||||
## than previously built packages with the same pcmkversion)
|
||||
%global pcmkversion 2.0.1
|
||||
%global specversion 2
|
||||
%global specversion 3
|
||||
|
||||
## Upstream commit (or git tag, such as "Pacemaker-" plus the
|
||||
## {pcmkversion} macro for an official release) to use for this package
|
||||
%global commit Pacemaker-2.0.1-rc3
|
||||
%global commit Pacemaker-2.0.1-rc4
|
||||
## 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.
|
||||
%global commit_abbrev 9
|
||||
@ -135,7 +135,7 @@
|
||||
Name: pacemaker
|
||||
Summary: Scalable High-Availability cluster resource manager
|
||||
Version: %{pcmkversion}
|
||||
Release: %{pcmk_release}%{?dist}.1
|
||||
Release: %{pcmk_release}%{?dist}
|
||||
License: GPLv2+ and LGPLv2+
|
||||
Url: http://www.clusterlabs.org
|
||||
|
||||
@ -144,11 +144,6 @@ Source0: https://github.com/%{github_owner}/%{name}/archive/%{commit}/%{na
|
||||
Source1: https://github.com/%{github_owner}/%{nagios_name}/archive/%{nagios_hash}/%{nagios_name}-%{nagios_hash}.tar.gz
|
||||
# ---
|
||||
# patches go here
|
||||
Patch0: https://github.com/%{github_owner}/%{name}/commit/abb6feeb39c027aa0c3f973ef93e3524ea866936.patch#/00-Fix-crm_mon-remove-duplicity-of-fence-action-state-i.patch
|
||||
Patch10: https://github.com/%{github_owner}/%{name}/pull/1677/commits/286569c1a2359a97ad33f77b3b6b63b04d520b76.patch#/10-Revert-Tests-cts-cli-Use-extended-regular-expression.patch
|
||||
Patch11: https://github.com/%{github_owner}/%{name}/pull/1677/commits/86ba5e63eff051aa01b4872cee97896aecf38ef9.patch#/11-Tests-cts-cli-simplify-fix-regexp-to-catch-crm_time_.patch
|
||||
#Patch12: .../pull/1677/commits/d76a2614ded697fb4adb117e5a6633008c31f60e.patch#/12-Build-configure-cts_scheduler-allow-skipping-broken-.patch
|
||||
Patch20: https://github.com/ClusterLabs/pacemaker/pull/1681/commits/a2e873635db3dfbb696527372dfaad9f58621f48.patch#/20-Build-2-.c-restore-GCC-9-Werror-buildability-avoid-N.patch
|
||||
|
||||
Requires: resource-agents
|
||||
Requires: %{name}-libs%{?_isa} = %{version}-%{release}
|
||||
@ -193,7 +188,7 @@ BuildRequires: asciidoc inkscape publican
|
||||
%endif
|
||||
|
||||
# git-style patch application
|
||||
BuildRequires: git
|
||||
#BuildRequires: git
|
||||
|
||||
Provides: pcmk-cluster-manager = %{version}-%{release}
|
||||
Provides: pcmk-cluster-manager%{?_isa} = %{version}-%{release}
|
||||
@ -351,9 +346,9 @@ monitor resources.
|
||||
|
||||
%prep
|
||||
%setup -q -a 1 -n %{name}-%{commit}
|
||||
%global __scm git_am
|
||||
%__scm_setup_git
|
||||
%autopatch -p1
|
||||
#global __scm git_am
|
||||
#__scm_setup_git
|
||||
#autopatch -p1
|
||||
|
||||
%build
|
||||
|
||||
@ -383,6 +378,7 @@ export LDFLAGS_HARDENED_LIB="%{?_hardening_ldflags}"
|
||||
%{?with_profiling: --with-profiling} \
|
||||
%{?with_coverage: --with-coverage} \
|
||||
%{!?with_doc: --with-brand=} \
|
||||
--enable-hash-affected-tests=try \
|
||||
%{?gnutls_priorities: --with-gnutls-priorities="%{gnutls_priorities}"} \
|
||||
--with-initdir=%{_initrddir} \
|
||||
--localstatedir=%{_var} \
|
||||
@ -709,6 +705,14 @@ exit 0
|
||||
%license %{nagios_name}-%{nagios_hash}/COPYING
|
||||
|
||||
%changelog
|
||||
* Mon Feb 04 2019 Jan Pokorný <jpokorny+rpm-pacemaker@redhat.com> - 2.0.1-0.3.rc4
|
||||
- Update for new upstream tarball for release candidate: Pacemaker-2.0.1-rc4,
|
||||
for full details, see included ChangeLog file or
|
||||
https://github.com/ClusterLabs/pacemaker/releases/tag/Pacemaker-2.0.1-rc4
|
||||
- Conditionally disable "hash affected tests" in cts-scheduler (-cts package),
|
||||
since it is unlikely glib v2.59.0+ present in the buildroot will be
|
||||
artificially downgraded post-deployment
|
||||
|
||||
* Fri Feb 01 2019 Fedora Release Engineering <releng@fedoraproject.org> - 2.0.1-0.2.rc3.1
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild
|
||||
|
||||
|
||||
@ -1,230 +0,0 @@
|
||||
From 1f05f5e22361f9c47aa5f23b0b1889b6eb09351a Mon Sep 17 00:00:00 2001
|
||||
From: Ken Gaillot <kgaillot@redhat.com>
|
||||
Date: Wed, 8 Aug 2018 15:26:26 -0500
|
||||
Subject: [PATCH 1/2] Fix: pacemaker-based: inform originator of CIB upgrade
|
||||
failure
|
||||
|
||||
"cibadmin --upgrade" sends an upgrade request to its local CIB manager,
|
||||
which forwards the request to the DC. If the DC successfully upgrades the CIB,
|
||||
it broadcasts a message causing all peers to perform the upgrade, which also
|
||||
results in local clients such as cibadmin being notified.
|
||||
|
||||
However, if the upgrade is either not necessary or fails, the DC would simply
|
||||
ignore the request, and local clients would time out waiting for a reply that
|
||||
would never come. Now, the DC will send the error result to the originating
|
||||
peer, which will notify its clients.
|
||||
---
|
||||
daemons/based/based_callbacks.c | 17 ++++++++++----
|
||||
daemons/based/based_messages.c | 40 ++++++++++++++++++++++++++++++---
|
||||
include/crm/cib/internal.h | 19 +++++-----------
|
||||
3 files changed, 55 insertions(+), 21 deletions(-)
|
||||
|
||||
diff --git a/daemons/based/based_callbacks.c b/daemons/based/based_callbacks.c
|
||||
index 11bcbef26..ba308c86f 100644
|
||||
--- a/daemons/based/based_callbacks.c
|
||||
+++ b/daemons/based/based_callbacks.c
|
||||
@@ -701,10 +701,18 @@ parse_peer_options_v2(int call_type, xmlNode * request,
|
||||
* limit on how far newer nodes will go
|
||||
*/
|
||||
const char *max = crm_element_value(request, F_CIB_SCHEMA_MAX);
|
||||
+ const char *upgrade_rc = crm_element_value(request, F_CIB_UPGRADE_RC);
|
||||
|
||||
- crm_trace("Parsing %s operation%s for %s with max=%s",
|
||||
- op, is_reply?" reply":"", cib_is_master?"master":"slave", max);
|
||||
- if(max == NULL && cib_is_master) {
|
||||
+ crm_trace("Parsing %s operation%s for %s with max=%s and upgrade_rc=%s",
|
||||
+ op, (is_reply? " reply" : ""),
|
||||
+ (cib_is_master? "master" : "slave"),
|
||||
+ (max? max : "none"), (upgrade_rc? upgrade_rc : "none"));
|
||||
+
|
||||
+ if (upgrade_rc != NULL) {
|
||||
+ // Our upgrade request was rejected by DC, notify clients of result
|
||||
+ crm_xml_add(request, F_CIB_RC, upgrade_rc);
|
||||
+
|
||||
+ } else if ((max == NULL) && cib_is_master) {
|
||||
/* We are the DC, check if this upgrade is allowed */
|
||||
goto skip_is_reply;
|
||||
|
||||
@@ -713,7 +721,8 @@ parse_peer_options_v2(int call_type, xmlNode * request,
|
||||
goto skip_is_reply;
|
||||
|
||||
} else {
|
||||
- return FALSE; /* Ignore */
|
||||
+ // Ignore broadcast client requests when we're not DC
|
||||
+ return FALSE;
|
||||
}
|
||||
|
||||
} else if (crm_is_true(update)) {
|
||||
diff --git a/daemons/based/based_messages.c b/daemons/based/based_messages.c
|
||||
index 9d733dc92..4f513e358 100644
|
||||
--- a/daemons/based/based_messages.c
|
||||
+++ b/daemons/based/based_messages.c
|
||||
@@ -211,6 +211,11 @@ cib_process_upgrade_server(const char *op, int options, const char *section, xml
|
||||
*answer = NULL;
|
||||
|
||||
if(crm_element_value(req, F_CIB_SCHEMA_MAX)) {
|
||||
+ /* The originator of an upgrade request sends it to the DC, without
|
||||
+ * F_CIB_SCHEMA_MAX. If an upgrade is needed, the DC re-broadcasts the
|
||||
+ * request with F_CIB_SCHEMA_MAX, and each node performs the upgrade
|
||||
+ * (and notifies its local clients) here.
|
||||
+ */
|
||||
return cib_process_upgrade(
|
||||
op, options, section, req, input, existing_cib, result_cib, answer);
|
||||
|
||||
@@ -220,6 +225,9 @@ cib_process_upgrade_server(const char *op, int options, const char *section, xml
|
||||
xmlNode *scratch = copy_xml(existing_cib);
|
||||
const char *host = crm_element_value(req, F_ORIG);
|
||||
const char *value = crm_element_value(existing_cib, XML_ATTR_VALIDATION);
|
||||
+ const char *client_id = crm_element_value(req, F_CIB_CLIENTID);
|
||||
+ const char *call_opts = crm_element_value(req, F_CIB_CALLOPTS);
|
||||
+ const char *call_id = crm_element_value(req, F_CIB_CALLID);
|
||||
|
||||
crm_trace("Processing \"%s\" event", op);
|
||||
if (value != NULL) {
|
||||
@@ -237,9 +245,9 @@ cib_process_upgrade_server(const char *op, int options, const char *section, xml
|
||||
crm_xml_add(up, F_CIB_OPERATION, CIB_OP_UPGRADE);
|
||||
crm_xml_add(up, F_CIB_SCHEMA_MAX, get_schema_name(new_version));
|
||||
crm_xml_add(up, F_CIB_DELEGATED, host);
|
||||
- crm_xml_add(up, F_CIB_CLIENTID, crm_element_value(req, F_CIB_CLIENTID));
|
||||
- crm_xml_add(up, F_CIB_CALLOPTS, crm_element_value(req, F_CIB_CALLOPTS));
|
||||
- crm_xml_add(up, F_CIB_CALLID, crm_element_value(req, F_CIB_CALLID));
|
||||
+ crm_xml_add(up, F_CIB_CLIENTID, client_id);
|
||||
+ crm_xml_add(up, F_CIB_CALLOPTS, call_opts);
|
||||
+ crm_xml_add(up, F_CIB_CALLID, call_id);
|
||||
|
||||
if (cib_legacy_mode() && cib_is_master) {
|
||||
rc = cib_process_upgrade(
|
||||
@@ -255,6 +263,32 @@ cib_process_upgrade_server(const char *op, int options, const char *section, xml
|
||||
rc = -pcmk_err_schema_unchanged;
|
||||
}
|
||||
|
||||
+ if (rc != pcmk_ok) {
|
||||
+ // Notify originating peer so it can notify its local clients
|
||||
+ crm_node_t *origin = crm_find_peer(0, host);
|
||||
+
|
||||
+ crm_info("Rejecting upgrade request from %s: %s "
|
||||
+ CRM_XS " rc=%d peer=%s", host, pcmk_strerror(rc), rc,
|
||||
+ (origin? origin->uname : "lost"));
|
||||
+
|
||||
+ if (origin) {
|
||||
+ xmlNode *up = create_xml_node(NULL, __FUNCTION__);
|
||||
+
|
||||
+ crm_xml_add(up, F_TYPE, "cib");
|
||||
+ crm_xml_add(up, F_CIB_OPERATION, CIB_OP_UPGRADE);
|
||||
+ crm_xml_add(up, F_CIB_DELEGATED, host);
|
||||
+ crm_xml_add(up, F_CIB_ISREPLY, host);
|
||||
+ crm_xml_add(up, F_CIB_CLIENTID, client_id);
|
||||
+ crm_xml_add(up, F_CIB_CALLOPTS, call_opts);
|
||||
+ crm_xml_add(up, F_CIB_CALLID, call_id);
|
||||
+ crm_xml_add_int(up, F_CIB_UPGRADE_RC, rc);
|
||||
+ if (send_cluster_message(origin, crm_msg_cib, up, TRUE)
|
||||
+ == FALSE) {
|
||||
+ crm_warn("Could not send CIB upgrade result to %s", host);
|
||||
+ }
|
||||
+ free_xml(up);
|
||||
+ }
|
||||
+ }
|
||||
free_xml(scratch);
|
||||
}
|
||||
return rc;
|
||||
diff --git a/include/crm/cib/internal.h b/include/crm/cib/internal.h
|
||||
index c3eb00f9f..5497fe9d3 100644
|
||||
--- a/include/crm/cib/internal.h
|
||||
+++ b/include/crm/cib/internal.h
|
||||
@@ -1,20 +1,10 @@
|
||||
/*
|
||||
- * Copyright (C) 2004 Andrew Beekhof <andrew@beekhof.net>
|
||||
+ * Copyright 2004-2018 Andrew Beekhof <andrew@beekhof.net>
|
||||
*
|
||||
- * This program is free software; you can redistribute it and/or
|
||||
- * modify it under the terms of the GNU Lesser General Public
|
||||
- * License as published by the Free Software Foundation; either
|
||||
- * version 2 of the License, or (at your option) any later version.
|
||||
- *
|
||||
- * This software is distributed in the hope that it will be useful,
|
||||
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
- * General Public License for more details.
|
||||
- *
|
||||
- * You should have received a copy of the GNU Lesser General Public
|
||||
- * License along with this library; if not, write to the Free Software
|
||||
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
+ * This source code is licensed under the GNU Lesser General Public License
|
||||
+ * version 2.1 or later (LGPLv2.1+) WITHOUT ANY WARRANTY.
|
||||
*/
|
||||
+
|
||||
#ifndef CIB_INTERNAL__H
|
||||
# define CIB_INTERNAL__H
|
||||
# include <crm/cib.h>
|
||||
@@ -46,6 +36,7 @@
|
||||
# define F_CIB_SECTION "cib_section"
|
||||
# define F_CIB_HOST "cib_host"
|
||||
# define F_CIB_RC "cib_rc"
|
||||
+# define F_CIB_UPGRADE_RC "cib_upgrade_rc"
|
||||
# define F_CIB_DELEGATED "cib_delegated_from"
|
||||
# define F_CIB_OBJID "cib_object"
|
||||
# define F_CIB_OBJTYPE "cib_object_type"
|
||||
--
|
||||
2.18.0.rc2
|
||||
|
||||
|
||||
From 8576f3a2058fd7191b9823d6ab83012b55a6b958 Mon Sep 17 00:00:00 2001
|
||||
From: Ken Gaillot <kgaillot@redhat.com>
|
||||
Date: Wed, 8 Aug 2018 16:02:05 -0500
|
||||
Subject: [PATCH 2/2] Low: tools: already latest schema is not failure for
|
||||
cibadmin --upgrade
|
||||
|
||||
a2950209 handled sync results only (cibadmin -s)
|
||||
---
|
||||
tools/cibadmin.c | 21 ++++++++++++++++-----
|
||||
1 file changed, 16 insertions(+), 5 deletions(-)
|
||||
|
||||
diff --git a/tools/cibadmin.c b/tools/cibadmin.c
|
||||
index 410eea930..96caf3483 100644
|
||||
--- a/tools/cibadmin.c
|
||||
+++ b/tools/cibadmin.c
|
||||
@@ -155,6 +155,17 @@ print_xml_output(xmlNode * xml)
|
||||
}
|
||||
}
|
||||
|
||||
+// Upgrade requested but already at latest schema
|
||||
+static void
|
||||
+report_schema_unchanged()
|
||||
+{
|
||||
+ const char *err = pcmk_strerror(pcmk_err_schema_unchanged);
|
||||
+
|
||||
+ crm_info("Upgrade unnecessary: %s\n", err);
|
||||
+ printf("Upgrade unnecessary: %s\n", err);
|
||||
+ exit_code = CRM_EX_OK;
|
||||
+}
|
||||
+
|
||||
int
|
||||
main(int argc, char **argv)
|
||||
{
|
||||
@@ -425,10 +436,7 @@ main(int argc, char **argv)
|
||||
|
||||
} else if ((rc == -pcmk_err_schema_unchanged)
|
||||
&& crm_str_eq(cib_action, CIB_OP_UPGRADE, TRUE)) {
|
||||
-
|
||||
- // Already at latest schema
|
||||
- crm_info("Upgrade unnecessary: %s\n", pcmk_strerror(rc));
|
||||
- printf("Upgrade unnecessary: %s\n", pcmk_strerror(rc));
|
||||
+ report_schema_unchanged();
|
||||
|
||||
} else if (rc < 0) {
|
||||
crm_err("Call failed: %s", pcmk_strerror(rc));
|
||||
@@ -513,7 +521,10 @@ cibadmin_op_callback(xmlNode * msg, int call_id, int rc, xmlNode * output, void
|
||||
{
|
||||
exit_code = crm_errno2exit(rc);
|
||||
|
||||
- if (rc != 0) {
|
||||
+ if (rc == -pcmk_err_schema_unchanged) {
|
||||
+ report_schema_unchanged();
|
||||
+
|
||||
+ } else if (rc != pcmk_ok) {
|
||||
crm_warn("Call %s failed (%d): %s", cib_action, rc, pcmk_strerror(rc));
|
||||
fprintf(stderr, "Call %s failed (%d): %s\n", cib_action, rc, pcmk_strerror(rc));
|
||||
print_xml_output(output);
|
||||
--
|
||||
2.18.0.rc2
|
||||
|
||||
2
sources
2
sources
@ -1,2 +1,2 @@
|
||||
SHA512 (pacemaker-2.0.1-rc3.tar.gz) = a51f65cad2ac24cae675d648ad20d8eb6618373b29b1a78e8d755cb3928429d40b85b965e042d69da5d89bc97437292a930883cabebca6e6c579863a6ff3207a
|
||||
SHA512 (pacemaker-2.0.1-rc4.tar.gz) = c4fa74134ae3a6c1dde6bab3f094a7d44754d01102d4e994de38b8afb943c1275d20fce3b43565d385c3004c43c2cf82c1242369de18c84292cef59b9da80c86
|
||||
SHA512 (nagios-agents-metadata-105ab8a7b2c16b9a29cf1c1596b80136eeef332b.tar.gz) = 11ddeb48a4929e7642b6dfa9c7962aa1d7a1af1c569830f55ed6cd6773abac13377317327bc1db8411c8077884f83f81cc54d746c834b63a99fa6dc219b5caad
|
||||
|
||||
Loading…
Reference in New Issue
Block a user