Public bug reported:

There is a bug in the resource agent's node_exist function. It looks at
crm_mon output, which has changed between bionic and focal.

The result is that the 'pgsql-status' and 'pgsql-data-status' attributes
are missing from crm status --as-xml output on focal.

Here is the focal output:
http://paste.ubuntu.com/p/RrFnPJHWCS/

Here is the bionic output:
http://paste.ubuntu.com/p/NrvqtjJD5r/

This is the node_exist function:

node_exist() {
    print_crm_mon | tr '[A-Z]' '[a-z]' | grep -q "^node $1"
}

It's looking for a line starting with "Node <nodename>".

That works in bionic, but in focal, it's " * Node <nodename>".

is_online has the same problem:

is_node_online() {
    print_crm_mon | tr '[A-Z]' '[a-z]' | grep -e "^node $1 " -e "^node $1:" | 
grep -q -v "offline"
}

It looks like this is the upstream:
https://github.com/ClusterLabs/resource-agents/blob/master/heartbeat/pgsql

It's fixed there; they look at crm_mon xml output instead.

I tested with changing the regex to "node $1:" and it works fine. that
could be tightened up a bit to just match "node <nodename>" or "  * node
<nodename>", but I'm not sure if we shouldn't just pull in something
from upstream so I haven't spent time refining that.

this is on focal with resource-agents 1:4.5.0-2ubuntu2

** Affects: resource-agents (Ubuntu)
     Importance: Undecided
         Status: New


** Tags: cdo-qa foundations-engine

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1900016

Title:
  pgsql resource agent uses regexes for old crm_mon format, breaks
  pgsql-status and pgsql-data-status attributes

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/resource-agents/+bug/1900016/+subscriptions

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to