Revision 5bf07049
b/lib/config.py | ||
---|---|---|
304 | 304 |
result.append("Not enough master candidates: actual %d, target %d" % |
305 | 305 |
(mc_now, mc_max)) |
306 | 306 |
|
307 |
# node checks |
|
308 |
for node in data.nodes.values(): |
|
309 |
if [node.master_candidate, node.drained, node.offline].count(True) > 1: |
|
310 |
result.append("Node %s state is invalid: master_candidate=%s," |
|
311 |
" drain=%s, offline=%s" % |
|
312 |
(node.name, node.master_candidate, node.drain, |
|
313 |
node.offline)) |
|
314 |
|
|
307 | 315 |
# drbd minors check |
308 | 316 |
d_map, duplicates = self._UnlockedComputeDRBDMap() |
309 | 317 |
for node, minor, instance_a, instance_b in duplicates: |
... | ... | |
903 | 911 |
""" |
904 | 912 |
mc_now = mc_max = 0 |
905 | 913 |
for node in self._config_data.nodes.itervalues(): |
906 |
if not node.offline:
|
|
914 |
if not (node.offline or node.drained):
|
|
907 | 915 |
mc_max += 1 |
908 | 916 |
if node.master_candidate: |
909 | 917 |
mc_now += 1 |
... | ... | |
939 | 947 |
if mc_now >= mc_max: |
940 | 948 |
break |
941 | 949 |
node = self._config_data.nodes[name] |
942 |
if node.master_candidate or node.offline: |
|
950 |
if node.master_candidate or node.offline or node.drained:
|
|
943 | 951 |
continue |
944 | 952 |
mod_list.append(node) |
945 | 953 |
node.master_candidate = True |
Also available in: Unified diff