RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1930578 - crm_resource --restart fails to restart clone instances except instance 0
Summary: crm_resource --restart fails to restart clone instances except instance 0
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 8
Classification: Red Hat
Component: pacemaker
Version: 8.3
Hardware: All
OS: Linux
low
low
Target Milestone: rc
: 8.7
Assignee: Chris Lumens
QA Contact: cluster-qe@redhat.com
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2021-02-19 08:18 UTC by Reid Wahl
Modified: 2022-11-08 10:38 UTC (History)
3 users (show)

Fixed In Version: pacemaker-2.1.3-1.el8
Doc Type: No Doc Update
Doc Text:
This issue will not occur if the user uses pcs to restart.
Clone Of:
Environment:
Last Closed: 2022-11-08 09:42:25 UTC
Type: Bug
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Knowledge Base (Solution) 5818431 0 None None None 2021-02-19 08:40:44 UTC
Red Hat Product Errata RHBA-2022:7573 0 None None None 2022-11-08 09:42:42 UTC

Description Reid Wahl 2021-02-19 08:18:44 UTC
Description of problem:

See the description below, but note that this applies to clones in general, not just to promotable clones.

Copied from comment 10 of BZ1925681:
~~~
I think we have additional problems with crm_resource's handling of clone instances (i.e., only using the first clone instance). The following test of the restart command is with the current master branch.

  * Clone Set: stateful-clone [stateful] (promotable):
    * Masters: [ node2 ]
    * Slaves: [ node1 ]

# crm_resource --restart --resource stateful --node node1
Performing update of 'target-role' on 'stateful-clone', the parent of 'stateful:0'
Set 'stateful-clone' option: id=stateful-clone-meta_attributes-target-role set=stateful-clone-meta_attributes name=target-role value=stopped
Waiting for 1 resources to stop:
 * stateful-clone
Performing delete of 'target-role' on 'stateful-clone', the parent of 'stateful:0'
Deleted 'stateful-clone' option: id=stateful-clone-meta_attributes-target-role name=target-role
Waiting for 1 resources to start again:
 * stateful-clone


# crm_resource --restart --resource stateful --node node2
stateful is not running on node2 and so cannot be restarted
crm_resource: Error performing operation: No such device or address

With trace enabled:
(resource_is_running_on)        trace: Resource stateful:0 is not running on: node2
stateful is not running on node2 and so cannot be restarted



cli_resource_restart has a similar issue to resource_search_list_default. It first checks whether rsc is running on the specified host. If not, it returns ENXIO. The problem is that the value of `rsc` is the one found earlier in main() by pe_find_resource_with_flags -- which, as we can see in comment 9, returns the first clone instance. Of course, this instance (stateful:0 in my example) will only be running on at most one node. So if stateful:0 is running on node 1 and stateful:1 is running on node 2, then an attempt to restart stateful on node 2 will fail.

    if(resource_is_running_on(rsc, host) == FALSE) {
        const char *id = rsc->clone_name?rsc->clone_name:rsc->id;
        if(host) {
            out->err(out, "%s is not running on %s and so cannot be restarted", id, host);
        } else {
            out->err(out, "%s is not running anywhere and so cannot be restarted", id);
        }
        return ENXIO;
    }
~~~

-----

Version-Release number of selected component (if applicable):

pacemaker-2.0.4-6.el8_3.1

-----

How reproducible:

Always

-----

Steps to Reproduce:
1. Create a clone resource (e.g., named "stateful") with no constraints so that it's allowed to run on all nodes.
2. Run `crm_resource --restart` for the resource on each cluster node as shown in the Description. (E.g., `crm_resource --restart -r stateful -N node1`).

-----

Actual results:

The resource is restarted on only one node. On the other nodes, the command fails with "crm_resource: Error performing operation: No such device or address".

-----

Expected results:

The resource is restarted on each node when the command is run for that node.

Comment 1 Reid Wahl 2021-02-19 08:26:00 UTC
This works fine when `--resource stateful-clone` is used instead of `--resource stateful`. I didn't notice that at first.

Pcs uses the stateful-clone syntax automatically, so I'm reducing this BZ to Low sev/priority.

Comment 4 Chris Lumens 2022-02-21 19:34:15 UTC
Potential fix that might be worth checking out - https://github.com/ClusterLabs/pacemaker/pull/2645

Comment 6 Ken Gaillot 2022-05-19 23:14:43 UTC
Fixed upstream as of commit ac29bf6

Comment 10 Markéta Smazová 2022-06-24 13:40:33 UTC
verified as SanityOnly in pacemaker-2.1.3-2.el8

Comment 12 errata-xmlrpc 2022-11-08 09:42:25 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (pacemaker bug fix and enhancement update), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2022:7573


Note You need to log in before you can comment on or make changes to this bug.