[SCM] Samba Shared Repository - branch master updated

Amitay Isaacs amitay at samba.org
Sun Jul 20 22:58:04 MDT 2014

The branch, master has been updated
       via  705e417 ctdb-recoverd: Gently abort recovery when election is underway
      from  d90f332 s4:torture/rpc: add rpc.netlogon.ServerReqChallengeGlobal


- Log -----------------------------------------------------------------
commit 705e4174c988eea5c5b3a834710f9f920369c8ee
Author: Martin Schwenke <martin at meltin.net>
Date:   Mon Jun 2 19:09:38 2014 +1000

    ctdb-recoverd: Gently abort recovery when election is underway
    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) {
    However, this check is done earlier so it leaves the race window open
    a little wider.
    Signed-off-by: Martin Schwenke <martin at meltin.net>
    Reviewed-by: Amitay Isaacs <amitay at gmail.com>
    Autobuild-User(master): Amitay Isaacs <amitay at samba.org>
    Autobuild-Date(master): Mon Jul 21 06:57:07 CEST 2014 on sn-devel-104


Summary of changes:
 ctdb/server/ctdb_recoverd.c |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)

Changeset truncated at 500 lines:

diff --git a/ctdb/server/ctdb_recoverd.c b/ctdb/server/ctdb_recoverd.c
index ab73e88..50709a6 100644
--- a/ctdb/server/ctdb_recoverd.c
+++ b/ctdb/server/ctdb_recoverd.c
@@ -1799,6 +1799,12 @@ static int do_recovery(struct ctdb_recoverd *rec,
 	/* if recovery fails, force it again */
 	rec->need_recovery = true;
+	if (rec->election_timeout) {
+		/* an election is in progress */
+		DEBUG(DEBUG_ERR, ("do_recovery called while election in progress - try again later\n"));
+		return -1;
+	}
 	ban_misbehaving_nodes(rec, &self_ban);
 	if (self_ban) {
 		DEBUG(DEBUG_NOTICE, ("This node was banned, aborting recovery\n"));

Samba Shared Repository

More information about the samba-cvs mailing list