-
Notifications
You must be signed in to change notification settings - Fork 116
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Disallow setting order constraints on resources within a group #509
Conversation
Can one of the admins verify this patch? |
test this please |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @F16shen,
Thank you for reporting this issue and submitting a pull request.
There are, however, several serious issues with your fix:
get_parent_resource
returnsNone
for resources which are not in a group, clone or bundle. If you pass that togroup.is_group
, as you do, it fails with a traceback.resource_set.is_resource_in_group
is called frompcs.lib.commands.constrait.common.create_with_set
unconditionally and therefore it applies to order constraints (which is good) as well as colocation and ticket constraints (which is not desired).- On the other hand, the check is not applied for plain order constraints -
pcs.constraint._order_add
- The check prevents creating a constraint if any resource in the constraint is in an arbitrary group. That seems to be unnecessarily strict. I think it would be sufficient to only disallow creating order constraint which apply to resources that are in the same group.
Also:
- If you called
resource_set.prepare_set
first and thenis_resource_in_group
, you wouldn't need to check if a resource exists.resource_set.prepare_set
would do that for you.
Hi @tomjelinek , |
test this please |
Hi @tomjelinek , |
test this please |
Hi @F16shen, I fixed it for you. |
Thanks, this really help me a lot |
test this please |
retest this please |
1 similar comment
retest this please |
Fix several crashes and bugs, clean up code
retest this please |
Found an Issue when sets constraint on resources within a group:
I have a two node cluster and resources like this:
and set an order constraint for dummy3 dummy1
pcs constraint order set dummy3 dummy1
It seems ok, but when I tried to move the group to another node, pcs reports error below
It looks like pacemaker doesn't allow this operation, but pcs has no warning about it(it really confused me until I delete that order constraint).Since resources in a group have their on boot sequence define by their position in the group, perhaps it's better to stop user set order constraint for them.
for now I still some complie issue unresolved, I thike it needs to modify tests but I'm not quite sure how to do it.
Thanks