recoverd: Stabilise the recovery master role
authorMartin Schwenke <martin@meltin.net>
Tue, 17 Sep 2013 02:00:26 +0000 (12:00 +1000)
committerAmitay Isaacs <amitay@gmail.com>
Thu, 19 Sep 2013 02:54:29 +0000 (12:54 +1000)
commitf0f48f22f45e4c82eba2582efae307e25385de81
tree616d751236800451e78c25278383d8d825d853b5
parent403938804caf1322f9773d63197e4303a7b2a788
recoverd: Stabilise the recovery master role

On rare occasions when a node that has been inactive it will trigger
an election when it becomes active again.  If that node has been up
for the longest then it will win the election and the recovery master
role will spuriously move.

While a node remains inactive we reset the priority time to discourage
it from winning elections.  The priority time will now reflect roughly
how long the node has been active rather than how long it has been up.
That means the most stable node is more likely to win elections.

Having a stable recovery master means that disabling takeover runs
while reloading IPs is more likely to succeed.  It also improves the
chances of being able to cache information in the recovery master -
for example, between takeover runs.

Signed-off-by: Martin Schwenke <martin@meltin.net>
server/ctdb_recoverd.c