ctdb/daemon: Untangle serialisation of 1st recovery -> startup -> monitor
authorMartin Schwenke <martin@meltin.net>
Wed, 18 Dec 2013 04:37:11 +0000 (15:37 +1100)
committerAmitay Isaacs <amitay@gmail.com>
Fri, 17 Jan 2014 06:59:41 +0000 (17:59 +1100)
commite6304d1e1adc86fc9c1199feb7b4802614fbc70f
tree5cd393af6ff5fe9d76f46c6311175bd13ca21e3f
parent50e00b3e5224d53df0f3cc882e71737f928e01cd
ctdb/daemon: Untangle serialisation of 1st recovery -> startup -> monitor

At the moment ctdb_check_healthy() is overloaded to wait until the
first recovery is complete, handle the "startup" event and also
actually handle monitoring.  This is untidy and hard to follow.

Instead, have the daemon explicitly wait for 1st recovery after the
"setup" event.  When first recovery is complete, schedule a function
to handle the "startup" event.  When the "startup" event succeeds then
explicitly enable monitoring.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
ctdb/include/ctdb_private.h
ctdb/server/ctdb_daemon.c
ctdb/server/ctdb_monitor.c