Commit cea0534a authored by Guido Trotter's avatar Guido Trotter
Browse files

Fix flipping MC flag bug

Currently unofflining or undraining an already functional master
candidate node, can cause it to demote itself. In order to avoid that we
only trigger the self-promotion check if the node is not currently a
Signed-off-by: default avatarGuido Trotter <>
Reviewed-by: default avatarIustin Pop <>
parent 7369e826
......@@ -3203,7 +3203,7 @@ class LUSetNodeParams(LogicalUnit):
# If we're being deofflined/drained, we'll MC ourself if needed
if (deoffline_or_drain and not offline_or_drain and not
self.op.master_candidate == True):
self.op.master_candidate == True and not node.master_candidate):
self.op.master_candidate = _DecideSelfPromotion(self)
if self.op.master_candidate:
self.LogInfo("Autopromoting node to master candidate")
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment