Merge ~bryce/ubuntu/+source/resource-agents:ubuntu/focal-devel into ubuntu/+source/resource-agents:ubuntu/focal

Proposed by Bryce Harrington
Status: Merged
Approved by: Bryce Harrington
Approved revision: bd339eea955c322f9fae388ea0c8787f65c36500
Merge reported by: Bryce Harrington
Merged at revision: bd339eea955c322f9fae388ea0c8787f65c36500
Proposed branch: ~bryce/ubuntu/+source/resource-agents:ubuntu/focal-devel
Merge into: ubuntu/+source/resource-agents:ubuntu/focal
Diff against target: 79 lines (+57/-0)
3 files modified
debian/changelog (+11/-0)
debian/patches/crm-mon-format.patch (+45/-0)
debian/patches/series (+1/-0)
Reviewer Review Type Date Requested Status
Lucas Kanashiro (community) Approve
Canonical Server Pending
Canonical Server Core Reviewers Pending
Canonical Server packageset reviewers Pending
Review via email: mp+392346@code.launchpad.net

Description of the change

Backport of an upstream fix for a cpe-foundation escalated bug.

I've confirmed the fix is included in the groovy version of resource-agents, although the fix is a bit different there in that it relies on XML rather than raw text parsing. So, while the focus is the focal SRU, it probably wouldn't hurt to also check that groovy's resource-agent works properly with the test case.

The commit didn't have an upstream bug report associated with it. I skimmed recently closed bug reports but didn't spot one; #1527 sounded close but actually covers a different issue.

PPA: https://launchpad.net/~bryce/+archive/ubuntu/resource-agents-sru-lp1900016-crm-mon-format
Bug: https://bugs.launchpad.net/ubuntu/groovy/+source/resource-agents/+bug/1900016

To post a comment you must log in.
Revision history for this message
Lucas Kanashiro (lucaskanashiro) wrote :

Thanks for this Bryce. The packaging changes look good, I am going to try to reproduce the issue to confirm it is indeed fixed with this upstream patch (also update the Test Case section in the SRU bug description).

Revision history for this message
Lucas Kanashiro (lucaskanashiro) wrote :

Bryce I did some back and forth with the field engineer and I added a test case to the bug description. Hopefully it will be enough to the SRU.

review: Approve
Revision history for this message
Bryce Harrington (bryce) wrote :

Thanks, tagged, pushed and uploaded:

$ git push pkg upload/1%4.5.0-2ubuntu2.1
Enumerating objects: 16, done.
Counting objects: 100% (16/16), done.
Delta compression using up to 12 threads
Compressing objects: 100% (11/11), done.
Writing objects: 100% (11/11), 2.37 KiB | 303.00 KiB/s, done.
Total 11 (delta 7), reused 0 (delta 0)
To ssh://git.launchpad.net/ubuntu/+source/resource-agents
 * [new tag] upload/1%4.5.0-2ubuntu2.1 -> upload/1%4.5.0-2ubuntu2.1

$ dput ubuntu resource-agents_4.5.0-2ubuntu2.1_source.changes
Checking signature on .changes
gpg: /home/bryce/pkg/ResourceAgents/sru-lp1900016-crm-mon-format/resource-agents_4.5.0-2ubuntu2.1_source.changes: Valid signature from E603B2578FB8F0FB
Checking signature on .dsc
gpg: /home/bryce/pkg/ResourceAgents/sru-lp1900016-crm-mon-format/resource-agents_4.5.0-2ubuntu2.1.dsc: Valid signature from E603B2578FB8F0FB
Uploading to ubuntu (via ftp to upload.ubuntu.com):
  Uploading resource-agents_4.5.0-2ubuntu2.1.dsc: done.
  Uploading resource-agents_4.5.0-2ubuntu2.1.debian.tar.xz: done.
  Uploading resource-agents_4.5.0-2ubuntu2.1_source.buildinfo: done.
  Uploading resource-agents_4.5.0-2ubuntu2.1_source.changes: done.
Successfully uploaded packages.

Revision history for this message
Bryce Harrington (bryce) wrote :

This has migrated

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/debian/changelog b/debian/changelog
2index befbee5..45fd7d3 100644
3--- a/debian/changelog
4+++ b/debian/changelog
5@@ -1,3 +1,14 @@
6+resource-agents (1:4.5.0-2ubuntu2.1) focal; urgency=medium
7+
8+ * d/p/crm-mon-format.patch: Support newer crm_mon output formats.
9+ The output of crm_mon -n1 changed to prefix node information with an
10+ asterisk, resulting in the node_exist() function failing to show
11+ correct information for nodes. This updates the code to accept the new
12+ node line format.
13+ (LP: #1900016)
14+
15+ -- Bryce Harrington <bryce@canonical.com> Fri, 16 Oct 2020 00:11:13 +0000
16+
17 resource-agents (1:4.5.0-2ubuntu2) focal; urgency=medium
18
19 * Remove bind9 autopkgtest not compatible with ubuntu (LP: #1872877)
20diff --git a/debian/patches/crm-mon-format.patch b/debian/patches/crm-mon-format.patch
21new file mode 100644
22index 0000000..acd31f5
23--- /dev/null
24+++ b/debian/patches/crm-mon-format.patch
25@@ -0,0 +1,45 @@
26+From 2a56d5b27dc54f498231fb2bfd4d67c1883b9dea Mon Sep 17 00:00:00 2001
27+From: yuskiida <yusk.iida@gmail.com>
28+Date: Thu, 16 Apr 2020 22:40:41 +0900
29+Subject: [PATCH] pgsql: support to crm_mon output for Pacemaker-2.0.3.
30+
31+Description: The output of crm_mon -n1 changed to prefix node
32+ information with an asterisk, resulting in the node_exist() function
33+ failing to show correct information for nodes. This updates the code
34+ to accept the new node line format.
35+Origin: upstream, https://github.com/ClusterLabs/resource-agents/commit/2a56d5b2
36+Bug-Ubuntu: https://bugs.launchpad.net/ubuntu/+source/resource-agents/+bug/1900016
37+Reviewed-By: Bryce Harrington <bryce@canonical.com>
38+Applied-Upstream: 4.6.0, https://github.com/ClusterLabs/resource-agents/compare/v4.5.0...v4.6.0rc1
39+
40+---
41+ heartbeat/pgsql | 6 +++---
42+ 1 file changed, 3 insertions(+), 3 deletions(-)
43+
44+diff --git a/heartbeat/pgsql b/heartbeat/pgsql
45+index c98db3aab..8d67b3ca7 100755
46+--- a/heartbeat/pgsql
47++++ b/heartbeat/pgsql
48+@@ -1040,7 +1040,7 @@ pgsql_replication_monitor() {
49+
50+ # I can't get master node name from $OCF_RESKEY_CRM_meta_notify_master_uname on monitor,
51+ # so I will get master node name using crm_mon -n
52+- print_crm_mon | tr -d "\t" | tr -d " " | grep -q "^${RESOURCE_NAME}[(:].*[):].*Master"
53++ print_crm_mon | tr -d "\t" | tr -d " " | grep -q -e "^${RESOURCE_NAME}[(:].*[):].*Master" -e "^\*${RESOURCE_NAME}[(:].*[):].*Master"
54+ if [ $? -ne 0 ] ; then
55+ # If I am Slave and Master is not exist
56+ ocf_log info "Master does not exist."
57+@@ -1815,11 +1815,11 @@ exec_with_retry() {
58+ }
59+
60+ is_node_online() {
61+- print_crm_mon | tr '[A-Z]' '[a-z]' | grep -e "^node $1 " -e "^node $1:" | grep -q -v "offline"
62++ print_crm_mon | tr '[A-Z]' '[a-z]' | grep -e "^node $1 " -e "^node $1:" -e "\* node $1:" | grep -q -v "offline"
63+ }
64+
65+ node_exist() {
66+- print_crm_mon | tr '[A-Z]' '[a-z]' | grep -q "^node $1"
67++ print_crm_mon | tr '[A-Z]' '[a-z]' | grep -q -e "^node $1" -e "\* node $1:"
68+ }
69+
70+ check_binary2() {
71diff --git a/debian/patches/series b/debian/patches/series
72index d4e9090..dd4d847 100644
73--- a/debian/patches/series
74+++ b/debian/patches/series
75@@ -6,3 +6,4 @@ ocft-configs.patch
76 gitignore.patch
77 reproducible.patch
78 var-run.patch
79+crm-mon-format.patch

Subscribers

People subscribed via source and target branches