In case LUClusterVerifyGroup is run on a group which doesn't contain
the master node, the following could happen:
- master node is selected due to the explicit check
- if the order of nodes in the 'absent_nodes' list is such that the
master node is the first in it, then we'll select (again) the master
node
- passing duplicate nodes to RPC calls will break due to RPC
internals; this should be fixed separately, but in the meantime we
just refrain from passing such duplicates
This patch should not change the semantics of the code, since it
wasn't guaranteed even before that we find a vm_capable node.
Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Bernardo Dal Seno <bdalseno@google.com>
if master_node not in self.my_node_info:
additional_nodes.append(master_node)
vf_node_info.append(self.all_node_info[master_node])
- # Add the first vm_capable node we find which is not included
+ # Add the first vm_capable node we find which is not included,
+ # excluding the master node (which we already have)
for node in absent_nodes:
nodeinfo = self.all_node_info[node]
- if nodeinfo.vm_capable and not nodeinfo.offline:
+ if (nodeinfo.vm_capable and not nodeinfo.offline and
+ node != master_node):
additional_nodes.append(node)
vf_node_info.append(self.all_node_info[node])
break