pacemaker: remove node on delete (SOC-11240)#2040
pacemaker: remove node on delete (SOC-11240)#2040sandonovsuse wants to merge 1 commit intocrowbar:masterfrom
Conversation
59b58f0 to
9df7bdf
Compare
|
|
||
| # Make sure pacemaker is the first to execute on node delete | ||
| if state == "delete" | ||
| roles.each_with_index do |role, index| |
There was a problem hiding this comment.
This loop will not work as expected. See https://stackoverflow.com/questions/31294630/is-it-safe-to-delete-from-an-array-inside-each for details.
TLDR
"when you delete an element, the elements following it will be shifted, hence the element that was supposed to be iterated next would be moved to the position of the deleted element, which has been iterated over already, and will be skipped."
There was a problem hiding this comment.
I understand, but the iteration breaks after it is deleted, ie. no further iteration after unshift. I could do:
prole = roles.delete_at(index)
roles.unshift(prole)
though I already tested it, it should be OK. Test results are in bsc#1170479.
c879765 to
d064f4c
Compare
|
|
||
| # Make sure pacemaker is the first to execute on node delete | ||
| if state == "delete" | ||
| index = roles.index { |role| role.name.include? "pacemaker" } |
There was a problem hiding this comment.
There are actually more than one role with "pacemaker" in the name. I'm not sure what was the original intention here.
Maybe search for "pacemaker-cluster-member" if that's what you want.
There was a problem hiding this comment.
Actually you're right, it should be pacemaker-config-$inst. Will make the changes
On node delete, pacemaker needs to remove the node from the cluster prior to being deleted from crowbar. This change adds said feature.
d064f4c to
2e60a22
Compare
|
Hmm. So I tried to test this (with crowbar-core/crowbar-ha packages that contain this pull request and crowbar/crowbar-ha#376 as patches) and it doesn't yield what I'd expect to be the result. I deleted one controller... ...and would have expected it to vanish from the stonith configuration in the cluster's proposal. It continues to be there though: |
|
@jgrassler try to use "Forget" option in crowbar instead of direct deleting in chef. |
On node delete, pacemaker needs to remove the node from the cluster
prior to being deleted from crowbar. This change adds said feature.