mirror of
https://github.com/samba-team/samba.git
synced 2025-01-12 09:18:10 +03:00
705e4174c9
Sometimes the recovery daemon fails to get the recovery lock on one node so that node is banned. This seems to always happen during an election. The recovery is triggered because other nodes are found to have recovery mode enabled. They have recovery mode enabled because an election has been forced. The recovery daemon's main_loop() only does an initial check for an election. After that, a node can force an election and, in the process, set itself to be the current winner. In this situation, verify_recmode() will always return MONITOR_RECOVERY_NEEDED so do_recovery() is called. If the previous recovery master hasn't admitted defeat and released the recovery lock, then do_recovery() will rightly fail. However, it would be better if it failed a little more gracefully, since this case is not that unusual. Instead of trying to take the recovery lock, return early with an error if there is an election in progress. Note that the race is still there but it is now much narrower. There are probably more subtle ways of avoiding this issue, including something like this in main_loop(): - if (pnn != rec->recmaster) { + if (pnn != rec->recmaster || rec->election_timeout) { return; } However, this check is done earlier so it leaves the race window open a little wider. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com> Autobuild-User(master): Amitay Isaacs <amitay@samba.org> Autobuild-Date(master): Mon Jul 21 06:57:07 CEST 2014 on sn-devel-104 |
||
---|---|---|
.. | ||
ctdb_banning.c | ||
ctdb_call.c | ||
ctdb_control.c | ||
ctdb_daemon.c | ||
ctdb_event_helper.c | ||
ctdb_freeze.c | ||
ctdb_keepalive.c | ||
ctdb_lock_helper.c | ||
ctdb_lock.c | ||
ctdb_logging.c | ||
ctdb_ltdb_server.c | ||
ctdb_monitor.c | ||
ctdb_persistent.c | ||
ctdb_recover.c | ||
ctdb_recoverd.c | ||
ctdb_server.c | ||
ctdb_serverids.c | ||
ctdb_statistics.c | ||
ctdb_takeover.c | ||
ctdb_traverse.c | ||
ctdb_tunables.c | ||
ctdb_update_record.c | ||
ctdb_uptime.c | ||
ctdb_vacuum.c | ||
ctdbd.c | ||
eventscript.c |