- master_node = results[node][2]
- if master_node == myself:
- positive += 1
- else:
- negative += 1
- if not master_node in other_masters:
- other_masters[master_node] = 0
- other_masters[master_node] += 1
- if positive <= negative:
- # bad!
- logging.critical("It seems we are not the master (%d votes for,"
- " %d votes against)", positive, negative)
- if len(other_masters) > 1:
- logging.critical("The other nodes do not agree on a single master")
- elif other_masters:
- # TODO: resync my files from the master
- logging.critical("It seems the real master is %s",
- other_masters.keys()[0])
- else:
- logging.critical("Can't contact any node for data, aborting startup")
+ break
+ if retries == 0:
+ logging.critical("Cluster inconsistent, most of the nodes didn't answer"
+ " after multiple retries. Aborting startup")