Bug 1522858
| Summary: | pcs constraint creation allows entering non-existing node name without error/verification | ||||||
|---|---|---|---|---|---|---|---|
| Product: | Red Hat Enterprise Linux 7 | Reporter: | Josef Zimek <pzimek> | ||||
| Component: | pcs | Assignee: | Tomas Jelinek <tojeline> | ||||
| Status: | CLOSED ERRATA | QA Contact: | cluster-qe <cluster-qe> | ||||
| Severity: | unspecified | Docs Contact: | |||||
| Priority: | medium | ||||||
| Version: | 7.2 | CC: | bfrank, cfeist, cluster-maint, idevat, mlisik, mmazoure, omular, pzimek, tojeline | ||||
| Target Milestone: | rc | ||||||
| Target Release: | --- | ||||||
| Hardware: | Unspecified | ||||||
| OS: | Unspecified | ||||||
| Whiteboard: | |||||||
| Fixed In Version: | pcs-0.9.167-1.el7 | Doc Type: | Bug Fix | ||||
| Doc Text: |
Cause:
User specifies a non-existent node when creating a location constraint.
Consequence:
The constraint is created but has no effect since it references a non-existent node.
Fix:
Warn if a node specified does not exist when creating a location constraint.
Result:
The user is informed the specified node does not exist. It is up to the user to decide if they made a mistake or they purposefully created a location constraint for a node they are about to add to the cluster.
|
Story Points: | --- | ||||
| Clone Of: | |||||||
| : | 1553718 (view as bug list) | Environment: | |||||
| Last Closed: | 2019-08-06 13:10:01 UTC | Type: | Bug | ||||
| Regression: | --- | Mount Type: | --- | ||||
| Documentation: | --- | CRM: | |||||
| Verified Versions: | Category: | --- | |||||
| oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |||||
| Cloudforms Team: | --- | Target Upstream Version: | |||||
| Embargoed: | |||||||
| Bug Depends On: | |||||||
| Bug Blocks: | 1546815 | ||||||
| Attachments: |
|
||||||
|
Description
Josef Zimek
2017-12-06 15:36:39 UTC
Node names in corosync.conf do not matter that much. It is node names in pacemaker which matters. Thanks to this it is possible to create constraints for remote/guest nodes which only pacemaker knows about as they are configured and handled solely by pacemaker. Now to the checking of node names. As I mentioned recently in bz1507548 comment 2: Pcs cannot check for hostname validity, such a check would: a) block a possibility to create a constraint for a node which is going to be added to a cluster later b) break backward compatibility I see three options here: 1) Allowing creating constraints for non-existing nodes is not a bug, it is actually a required feature - see a) above 2) Allowing creating constraints for non-existing nodes is a bug, pcs should: 2a) print a warning and create a constraint 2b) exit with an error and require --force for such a constraint to be created, which breaks backward compatibility. I understand that pcs allowing creation of constraints with non-existing nodes may be a problem. However, going with 2b, which would prevent it, may not be an option. Josef, what do you think? Do you see any other option? Valid points, I didn't take into account pacemaker remote nodes. So if we consider creation of constraint with non-existing node name desirable i.e. for future expansion of cluster then option 2a sounds plausible to me. We should at least notify user that node defined in constraint is not known to pacemaker at the moment so user might want to double-check if it matches real node names (from pacemaker perspective) or his/her future plans. This will prevent wrong assumptions that short names in constraint will resolve to FQDN automatically (it doesn't) yet still allow create constraint for future use. If 2a does not create backwards compatibility issues then I would go that way. Something like this will do the trick: "Warning: specified node name doesn't match any existing pacemaker node name: <list of valid existing pacemaker node names>. If specified node name is for node which is about to be added in future you can ignore this warning" Created attachment 1507939 [details]
proposed fix
Test:
[root@rh76-node1:~]# pcs status nodes
Pacemaker Nodes:
Online: rh76-node1 rh76-node2
Standby:
Maintenance:
Offline:
Pacemaker Remote Nodes:
Online:
Standby:
Maintenance:
Offline:
[root@rh76-node1:~]# pcs resource
d1 (ocf::pacemaker:Dummy): Started rh76-node2
d2 (ocf::pacemaker:Dummy): Started rh76-node1
[root@rh76-node1:~]# pcs constraint location
Location Constraints:
[root@rh76-node1:~]# pcs constraint location add loc-con1 d1 unknown_node 123
Warning: Node 'unknown_node' does not seem to be in the cluster. If you are about to add node 'unknown_node' to the cluster, you can safely ignore this warning.
[root@rh76-node1:~]# echo $?
0
[root@rh76-node1:~]# pcs constraint location add loc-con2 d1 rh76-node1 111
[root@rh76-node1:~]# echo $?
0
[root@rh76-node1:~]# pcs constraint location d1 prefers unknown_node2=321
Warning: Node 'unknown_node2' does not seem to be in the cluster. If you are about to add node 'unknown_node2' to the cluster, you can safely ignore this warning.
[root@rh76-node1:~]# echo $?
0
[root@rh76-node1:~]# pcs constraint location d1 avoids unknown_node3
Warning: Node 'unknown_node3' does not seem to be in the cluster. If you are about to add node 'unknown_node3' to the cluster, you can safely ignore this warning.
[root@rh76-node1:~]# echo $?
0
[root@rh76-node1:~]# pcs constraint location
Location Constraints:
Resource: d1
Enabled on: unknown_node (score:123)
Enabled on: rh76-node1 (score:111)
Enabled on: unknown_node2 (score:321)
Disabled on: unknown_node3 (score:-INFINITY)
After Fix:
[kid76 ~] $ rpm -q pcs
pcs-0.9.167-1.el7.x86_64
[kid76 ~] $ pcs status nodes
Pacemaker Nodes:
Online: kid76 lion76
Standby:
Maintenance:
Offline:
Pacemaker Remote Nodes:
Online:
Standby:
Maintenance:
Offline:
[kid76 ~] $ pcs resource
R (ocf::heartbeat:Dummy): Started kid76
[kid76 ~] $ pcs constraint location
Location Constraints:
[kid76 ~] $ pcs constraint location add L R UNKNOWN_NODE 123
Warning: Node 'UNKNOWN_NODE' does not seem to be in the cluster. If you are about to add node 'UNKNOWN_NODE' to the cluster, you can safely ignore this warning.
[kid76 ~] $ echo $?
0
[kid76 ~] $ pcs constraint location add L2 R lion76 111
[kid76 ~] $ echo $?
0
[kid76 ~] $ pcs constraint location R prefers UNKNOWN_NODE2=321
Warning: Node 'UNKNOWN_NODE2' does not seem to be in the cluster. If you are about to add node 'UNKNOWN_NODE2' to the cluster, you can safely ignore this warning.
[kid76 ~] $ echo $?
0
[kid76 ~] $ pcs constraint location R avoids UNKNOWN_NODE3
Warning: Node 'UNKNOWN_NODE3' does not seem to be in the cluster. If you are about to add node 'UNKNOWN_NODE3' to the cluster, you can safely ignore this warning.
[kid76 ~] $ echo $?
0
[kid76 ~] $ pcs constraint location
Location Constraints:
Resource: R
Enabled on: UNKNOWN_NODE (score:123)
Enabled on: lion76 (score:111)
Enabled on: UNKNOWN_NODE2 (score:321)
Disabled on: UNKNOWN_NODE3 (score:-INFINITY)
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, 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-2019:2244 |