Bug 1824206
Summary: | pcs should keep XML IDs to a reasonable length | ||||||
---|---|---|---|---|---|---|---|
Product: | Red Hat Enterprise Linux 7 | Reporter: | Ken Gaillot <kgaillot> | ||||
Component: | pcs | Assignee: | Tomas Jelinek <tojeline> | ||||
Status: | CLOSED ERRATA | QA Contact: | cluster-qe <cluster-qe> | ||||
Severity: | medium | Docs Contact: | |||||
Priority: | high | ||||||
Version: | 7.7 | CC: | ccaulfie, cfeist, cluster-maint, cluster-qe, dhellard, idevat, jfriesse, jreznik, juholmes, kgaillot, kostos, michael.oldham, mlisik, mmazoure, mpospisi, nhostako, omular, sbradley, tojeline | ||||
Target Milestone: | rc | Keywords: | ZStream | ||||
Target Release: | --- | ||||||
Hardware: | x86_64 | ||||||
OS: | Linux | ||||||
Whiteboard: | |||||||
Fixed In Version: | pcs-0.9.169-2.el7 | Doc Type: | Bug Fix | ||||
Doc Text: |
Cause:
User creates a set constraint referencing several resources. Pcs generates an ID for such constraint by concatenating all the resources' names.
Consequence:
Resulting IDs may be extremely long which causes various issues. The IDs do not fit in pcs output and logs and are generally hard to work with.
Fix:
Auto-generated set constraints' IDs no longer consist of all resources referenced in constraints.
Result:
Reasonably short IDs fit better in pcs output, logs and are generally easier to work with.
|
Story Points: | --- | ||||
Clone Of: | 1822125 | ||||||
: | 1892685 (view as bug list) | Environment: | |||||
Last Closed: | 2020-09-29 20:10:26 UTC | Type: | --- | ||||
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: | 1822125 | ||||||
Bug Blocks: | 1892685 | ||||||
Attachments: |
|
Description
Ken Gaillot
2020-04-15 14:25:39 UTC
Created attachment 1679679 [details]
proposed fix + tests
Changed the way IDs for set constraints are generated, they no longer consist of full names of all resources in the constraints.
Generating other IDs was not changed. Plain constraints reference two resources, therefore there is no risk of 1KB+ IDs (unless the resource IDs are that long). Other IDs are either provided by the user or reasonably short. If you find it's not the case, feel free to open another BZ with a reproducer. If plain constraint IDs are still too long, feel free to open a BZ for that as well.
Test: Create set constraints with several resources. Check that the auto-generated constraint IDs are reasonably short.
Before Fix [kid76 ~] $ rpm -q pcs pcs-0.9.169-1.el7.x86_64 [kid76 ~] $ pcs constraint colocation set A B C [kid76 ~] $ pcs cluster cib |grep pcs_rsc_colocation_set_A_B_C <rsc_colocation score="INFINITY" id="pcs_rsc_colocation_set_A_B_C"> After Fix [kid76 ~] $ rpm -q pcs pcs-0.9.169-2.el7.x86_64 kid76 ~] $ pcs constraint colocation set A B C [kid76 ~] $ pcs cluster cib |grep colocation_set_AABBCC <rsc_colocation score="INFINITY" id="colocation_set_AABBCC"> <resource_set id="colocation_set_AABBCC_set"> Hi, just to confirm behaviour here because your example does not really show me the solution. We have 100+ resources with names like sv.svtest.aa.partition.17. Can you show your solution output when using longer resource names? Thanks Michael (In reply to michael.oldham from comment #8) > Hi, just to confirm behaviour here because your example does not really show > me the solution. > We have 100+ resources with names like sv.svtest.aa.partition.17. > > Can you show your solution output when using longer resource names? > Thanks > Michael Sure, here it is: # pcs constraint order set sv.svtest.aa.partition.1 sv.svtest.aa.partition.2 sv.svtest.aa.partition.3 set sv.svtest.aa.partition.4 sv.svtest.aa.partition.5 sv.svtest.aa.partition.6 # pcs constraint order set sv.svtest.aa.partition.1 sv.svtest.aa.partition.2 set sv.svtest.aa.partition.3 sv.svtest.aa.partition.4 set sv.svtest.aa.partition.5 sv.svtest.aa.partition.6 # pcs cluster cib | grep order <rsc_order id="order_set_s1s2s3"> <resource_set id="order_set_s1s2s3_set"> <resource_set id="order_set_s1s2s3_set-1"> </rsc_order> <rsc_order id="order_set_s1s2s3-1"> <resource_set id="order_set_s1s2s3-1_set"> <resource_set id="order_set_s1s2s3-1_set-1"> <resource_set id="order_set_s1s2s3-1_set-2"> </rsc_order> Hopefully, this gives you better idea about how it works. Let me know if you have any questions. Regards, Tomas Yes it does thank you very much .. looks good Regards Michael Hi, have you any idea of the timeline for this fix .. I understand it would be available with RHEL7.9 but when would that be available. Is there anyway of getting the fix into the existing 7.7 release? Cheers Michael Michael, Currently I don't believe this is planned for 7.7, however if this is critical for you, please raise this with your support representative and we can evaluate the possibility of a backport/z-stream. BEFORE: ======= [root@virt-202 ~]# rpm -q pcs pcs-0.9.168-4.el7.x86_64 ## Creating resources [root@virt-202 ~]# pcs resource create sv.svtest.aa.partition.1 ocf:heartbeat:Dummy [root@virt-202 ~]# pcs resource create sv.svtest.aa.partition.2 ocf:heartbeat:Dummy [root@virt-202 ~]# pcs resource create sv.svtest.aa.partition.3 ocf:heartbeat:Dummy [root@virt-202 ~]# pcs resource create sv.svtest.aa.partition.4 ocf:heartbeat:Dummy [root@virt-202 ~]# pcs resource create sv.svtest.aa.partition.5 ocf:heartbeat:Dummy [root@virt-202 ~]# pcs resource create sv.svtest.aa.partition.6 ocf:heartbeat:Dummy [root@virt-202 ~]# pcs resource sv.svtest.aa.partition.1 (ocf::heartbeat:Dummy): Started virt-202 sv.svtest.aa.partition.2 (ocf::heartbeat:Dummy): Started virt-203 sv.svtest.aa.partition.3 (ocf::heartbeat:Dummy): Started virt-202 sv.svtest.aa.partition.4 (ocf::heartbeat:Dummy): Started virt-203 sv.svtest.aa.partition.5 (ocf::heartbeat:Dummy): Started virt-202 sv.svtest.aa.partition.6 (ocf::heartbeat:Dummy): Started virt-203 ## Creating order set constraint [root@virt-202 ~]# pcs constraint order set sv.svtest.aa.partition.1 sv.svtest.aa.partition.2 sv.svtest.aa.partition.3 sv.svtest.aa.partition.4 sv.svtest.aa.partition.5 sv.svtest.aa.partition.6 ## Checking the constraint ID [root@virt-202 ~]# pcs constraint --full Location Constraints: Ordering Constraints: Resource Sets: set sv.svtest.aa.partition.1 sv.svtest.aa.partition.2 sv.svtest.aa.partition.3 sv.svtest.aa.partition.4 sv.svtest.aa.partition.5 sv.svtest.aa.partition.6 (id:pcs_rsc_set_sv.svtest.aa.partition.1_sv.svtest.aa.partition.2_sv.svtest.aa.partition.3_sv.svtest.aa.partition.4_sv.svtest.aa.partition.5_sv.svtest.aa.partition.6) (id:pcs_rsc_order_set_sv.svtest.aa.partition.1_sv.svtest.aa.partition.2_sv.svtest.aa.partition.3_sv.svtest.aa.partition.4_sv.svtest.aa.partition.5_sv.svtest.aa.partition.6) Colocation Constraints: Ticket Constraints: [root@virt-202 ~]# pcs cluster cib | grep \<constraints\> -A 11 <constraints> <rsc_order id="pcs_rsc_order_set_sv.svtest.aa.partition.1_sv.svtest.aa.partition.2_sv.svtest.aa.partition.3_sv.svtest.aa.partition.4_sv.svtest.aa.partition.5_sv.svtest.aa.partition.6"> <resource_set id="pcs_rsc_set_sv.svtest.aa.partition.1_sv.svtest.aa.partition.2_sv.svtest.aa.partition.3_sv.svtest.aa.partition.4_sv.svtest.aa.partition.5_sv.svtest.aa.partition.6"> <resource_ref id="sv.svtest.aa.partition.1"/> <resource_ref id="sv.svtest.aa.partition.2"/> <resource_ref id="sv.svtest.aa.partition.3"/> <resource_ref id="sv.svtest.aa.partition.4"/> <resource_ref id="sv.svtest.aa.partition.5"/> <resource_ref id="sv.svtest.aa.partition.6"/> </resource_set> </rsc_order> </constraints> > The constraint ID is too long AFTER: ====== [root@virt-029 ~]# rpm -q pcs pcs-0.9.169-2.el7.x86_64 ## Creating resources [root@virt-029 ~]# pcs resource create sv.svtest.aa.partition.1 ocf:heartbeat:Dummy [root@virt-029 ~]# pcs resource create sv.svtest.aa.partition.2 ocf:heartbeat:Dummy [root@virt-029 ~]# pcs resource create sv.svtest.aa.partition.3 ocf:heartbeat:Dummy [root@virt-029 ~]# pcs resource create sv.svtest.aa.partition.4 ocf:heartbeat:Dummy [root@virt-029 ~]# pcs resource create sv.svtest.aa.partition.5 ocf:heartbeat:Dummy [root@virt-029 ~]# pcs resource create sv.svtest.aa.partition.6 ocf:heartbeat:Dummy [root@virt-029 ~]# pcs resource sv.svtest.aa.partition.1 (ocf::heartbeat:Dummy): Started virt-029 sv.svtest.aa.partition.2 (ocf::heartbeat:Dummy): Started virt-030 sv.svtest.aa.partition.3 (ocf::heartbeat:Dummy): Started virt-029 sv.svtest.aa.partition.4 (ocf::heartbeat:Dummy): Started virt-030 sv.svtest.aa.partition.5 (ocf::heartbeat:Dummy): Started virt-029 sv.svtest.aa.partition.6 (ocf::heartbeat:Dummy): Started virt-030 ## Creating order set constraint [root@virt-029 ~]# pcs constraint order set sv.svtest.aa.partition.1 sv.svtest.aa.partition.2 sv.svtest.aa.partition.3 sv.svtest.aa.partition.4 sv.svtest.aa.partition.5 sv.svtest.aa.partition.6 ## Checking the constraint ID [root@virt-029 ~]# pcs constraint --full Location Constraints: Ordering Constraints: Resource Sets: set sv.svtest.aa.partition.1 sv.svtest.aa.partition.2 sv.svtest.aa.partition.3 sv.svtest.aa.partition.4 sv.svtest.aa.partition.5 sv.svtest.aa.partition.6 (id:order_set_s1s2s3_set) (id:order_set_s1s2s3) Colocation Constraints: Ticket Constraints: [root@virt-029 ~]# pcs cluster cib | grep \<constraints\> -A 11 <constraints> <rsc_order id="order_set_s1s2s3"> <resource_set id="order_set_s1s2s3_set"> <resource_ref id="sv.svtest.aa.partition.1"/> <resource_ref id="sv.svtest.aa.partition.2"/> <resource_ref id="sv.svtest.aa.partition.3"/> <resource_ref id="sv.svtest.aa.partition.4"/> <resource_ref id="sv.svtest.aa.partition.5"/> <resource_ref id="sv.svtest.aa.partition.6"/> </resource_set> </rsc_order> </constraints> > OK: The ID is no longer consist of full names of all resources in the constraint and is reasonable short. ## Removing constraint via ID [root@virt-029 ~]# pcs constraint remove order_set_s1s2s3 [root@virt-029 ~]# pcs constraint Location Constraints: Ordering Constraints: Colocation Constraints: Ticket Constraints: > OK ## Creating multiple sets [root@virt-029 ~]# pcs constraint order set sv.svtest.aa.partition.1 sv.svtest.aa.partition.2 set sv.svtest.aa.partition.3 sv.svtest.aa.partition.4 set sv.svtest.aa.partition.5 sv.svtest.aa.partition.6 ## Checking the ID [root@virt-029 ~]# pcs constraint --full Location Constraints: Ordering Constraints: Resource Sets: set sv.svtest.aa.partition.1 sv.svtest.aa.partition.2 (id:order_set_s1s2s3_set) set sv.svtest.aa.partition.3 sv.svtest.aa.partition.4 (id:order_set_s1s2s3_set-1) set sv.svtest.aa.partition.5 sv.svtest.aa.partition.6 (id:order_set_s1s2s3_set-2) (id:order_set_s1s2s3) Colocation Constraints: Ticket Constraints: [root@virt-029 ~]# pcs cluster cib | grep \<constraints\> -A 15 <constraints> <rsc_order id="order_set_s1s2s3"> <resource_set id="order_set_s1s2s3_set"> <resource_ref id="sv.svtest.aa.partition.1"/> <resource_ref id="sv.svtest.aa.partition.2"/> </resource_set> <resource_set id="order_set_s1s2s3_set-1"> <resource_ref id="sv.svtest.aa.partition.3"/> <resource_ref id="sv.svtest.aa.partition.3"/> <resource_ref id="sv.svtest.aa.partition.4"/> </resource_set> <resource_set id="order_set_s1s2s3_set-2"> <resource_ref id="sv.svtest.aa.partition.5"/> <resource_ref id="sv.svtest.aa.partition.6"/> </resource_set> </rsc_order> </constraints> > OK [root@virt-029 ~]# pcs constraint remove order_set_s1s2s3 ## Creating colocation set [root@virt-029 ~]# pcs constraint colocation set sv.svtest.aa.partition.1 sv.svtest.aa.partition.2 sv.svtest.aa.partition.3 sv.svtest.aa.partition.4 sv.svtest.aa.partition.5 sv.svtest.aa.partition.6 ## Checking the ID [root@virt-029 ~]# pcs constraint --full Location Constraints: Ordering Constraints: Colocation Constraints: Resource Sets: set sv.svtest.aa.partition.1 sv.svtest.aa.partition.2 sv.svtest.aa.partition.3 sv.svtest.aa.partition.4 sv.svtest.aa.partition.5 sv.svtest.aa.partition.6 (id:colocation_set_s1s2s3_set) setoptions score=INFINITY (id:colocation_set_s1s2s3) Ticket Constraints: [root@virt-029 ~]# pcs cluster cib | grep \<constraints\> -A 11 <constraints> <rsc_colocation score="INFINITY" id="colocation_set_s1s2s3"> <resource_set id="colocation_set_s1s2s3_set"> <resource_ref id="sv.svtest.aa.partition.1"/> <resource_ref id="sv.svtest.aa.partition.2"/> <resource_ref id="sv.svtest.aa.partition.3"/> <resource_ref id="sv.svtest.aa.partition.4"/> <resource_ref id="sv.svtest.aa.partition.5"/> <resource_ref id="sv.svtest.aa.partition.6"/> </resource_set> </rsc_colocation> </constraints> > OK [root@virt-029 ~]# pcs constraint remove colocation_set_s1s2s3 ## Checking, how the ID is created (semi-random ID) ## Creating more resources with distinctive names [root@virt-029 ~]# pcs resource create apache ocf:heartbeat:Dummy [root@virt-029 ~]# pcs resource create sqlserver ocf:heartbeat:Dummy [root@virt-029 ~]# pcs resource create virtualIP ocf:heartbeat:Dummy [root@virt-029 ~]# pcs resource create dummy ocf:heartbeat:Dummy ## Creating constraint set [root@virt-029 ~]# pcs constraint order set apache sqlserver virtualIP dummy ## Checking the ID's name [root@virt-029 ~]# pcs cluster cib | grep order <rsc_order id="order_set_aesrvP"> <resource_set id="order_set_aesrvP_set"> </rsc_order> > The ID is created by taking the first and the last character from the first thee resources names [root@virt-029 ~]# pcs constraint remove order_set_aesrvP [root@virt-029 ~]# pcs constraint order set sv.svtest.aa.partition.6 apache dummy sv.svtest.aa.partition.4 sv.svtest.aa.partition.5 virtualIP sqlserver [root@virt-029 ~]# pcs cluster cib | grep order <rsc_order id="order_set_s6aedy"> <resource_set id="order_set_s6aedy_set"> </rsc_order> > OK [root@virt-029 ~]# pcs constraint delete order_set_s6aedy ## Creating plain constraint [root@virt-029 ~]# pcs constraint order sv.svtest.aa.partition.1 then sv.svtest.aa.partition.2 Adding sv.svtest.aa.partition.1 sv.svtest.aa.partition.2 (kind: Mandatory) (Options: first-action=start then-action=start) [root@virt-029 ~]# pcs constraint --full Location Constraints: Ordering Constraints: start sv.svtest.aa.partition.1 then start sv.svtest.aa.partition.2 (kind:Mandatory) (id:order-sv.svtest.aa.partition.1-sv.svtest.aa.partition.2-mandatory) Colocation Constraints: Ticket Constraints: [root@virt-029 ~]# pcs cluster cib | grep \<constraints\> -A 2 <constraints> <rsc_order first="sv.svtest.aa.partition.1" first-action="start" id="order-sv.svtest.aa.partition.1-sv.svtest.aa.partition.2-mandatory" then="sv.svtest.aa.partition.2" then-action="start"/> </constraints> > The ID is not shortened, since only two resource can be referenced in plain constraint Marking as VERIFIED in pcs-0.9.169-2.el7 SA Greg Richardson created internal ACE to increase awareness, (EN-EN-31176). Set the Customer Escalation Flag = Yes. 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 (pcs 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-2020:3964 |