[SCM] Samba Shared Repository - branch master updated

Martin Schwenke martins at samba.org
Fri May 6 13:12:03 UTC 2016


The branch, master has been updated
       via  866ca59 ctdb-recoverd: Fold IP allocation house-keeping into IP verification
       via  4947789 ctdb-recoverd: Clean up local IP verification
       via  bdcc796 ctdb-recoverd: Skip known IP address checking when it is disabled
       via  fc4cbf5 ctdb-recoverd: Check that IP failover is active in IP verification
       via  ff28cbb ctdb-recoverd: Call election when necessary in recovery master validation
       via  e8c33aa ctdb-recoverd: Simplify return values when updating local flags
       via  0a9401f ctdb-recoverd: Drop unreachable code
       via  e225fbd ctdb-protocol: Drop unused CTDB_SRVID_TAKEOVER_RUN_RESPONSE
       via  4bef374 ctdb-daemon: Don't use CTDB_SRVID_TAKEOVER_RUN_RESPONSE
       via  3e272e0 ctdb-recover: Avoid duplicate deferred attach processing
      from  f74f2e0 examples/crackcheck: allow compilation with current builds

https://git.samba.org/?p=samba.git;a=shortlog;h=master


- Log -----------------------------------------------------------------
commit 866ca591d48b462a1d12785d4139aeb08525a9f9
Author: Martin Schwenke <martin at meltin.net>
Date:   Tue May 3 16:36:37 2016 +1000

    ctdb-recoverd: Fold IP allocation house-keeping into IP verification
    
    Now all the IP takeover code for non-master node is in this function.
    The function can always be renamed to something more suitable.
    
    Signed-off-by: Martin Schwenke <martin at meltin.net>
    Reviewed-by: Amitay Isaacs <amitay at gmail.com>
    
    Autobuild-User(master): Martin Schwenke <martins at samba.org>
    Autobuild-Date(master): Fri May  6 15:10:59 CEST 2016 on sn-devel-144

commit 4947789b2a3af4a24a01c21762042b8fe0b74bbc
Author: Martin Schwenke <martin at meltin.net>
Date:   Mon Nov 9 16:12:31 2015 +1100

    ctdb-recoverd: Clean up local IP verification
    
    Update log levels and messages, comments and wrapping of long lines.
    No functional changes.
    
    Note that interfaces_have_changed() already does adequate logging.
    
    Signed-off-by: Martin Schwenke <martin at meltin.net>
    Reviewed-by: Amitay Isaacs <amitay at gmail.com>

commit bdcc796f3c00aac946f3128fb27c468980b90afa
Author: Martin Schwenke <martin at meltin.net>
Date:   Mon Nov 9 15:44:15 2015 +1100

    ctdb-recoverd: Skip known IP address checking when it is disabled
    
    When public IP checking is disabled, verify_local_ip_allocation()
    still retrieves known IP addresses and runs through a loop that does
    nothing.
    
    Instead, completely skip the retrieval and checking loop.
    
    Signed-off-by: Martin Schwenke <martin at meltin.net>
    Reviewed-by: Amitay Isaacs <amitay at gmail.com>

commit fc4cbf552813c6742ebf25b011600530e0badfd9
Author: Martin Schwenke <martin at meltin.net>
Date:   Mon Nov 9 15:41:45 2015 +1100

    ctdb-recoverd: Check that IP failover is active in IP verification
    
    This makes verify_local_ip_allocation() self-contained and simplifies
    main_loop().
    
    Due to indentation changes, this commit is most easily read when
    ignoring whitespace.
    
    Signed-off-by: Martin Schwenke <martin at meltin.net>
    Reviewed-by: Amitay Isaacs <amitay at gmail.com>

commit ff28cbb73de0018a76c39c9dd923af00c4ea4b7a
Author: Martin Schwenke <martin at meltin.net>
Date:   Thu Apr 28 16:58:35 2016 +1000

    ctdb-recoverd: Call election when necessary in recovery master validation
    
    There is no need to return one of several states and then trigger an
    election for one of those return states.  Have the recovery master
    validation trigger the election directly and just return whether
    monitoring should continue.
    
    Signed-off-by: Martin Schwenke <martin at meltin.net>
    Reviewed-by: Amitay Isaacs <amitay at gmail.com>

commit e8c33aa24a736caa42be966092c7c12ddc42e9f4
Author: Martin Schwenke <martin at meltin.net>
Date:   Wed Apr 27 21:47:08 2016 +1000

    ctdb-recoverd: Simplify return values when updating local flags
    
    Change this to return just 0 or -1.  It isn't monitoring anything.
    
    Signed-off-by: Martin Schwenke <martin at meltin.net>
    Reviewed-by: Amitay Isaacs <amitay at gmail.com>

commit 0a9401ff0ebfeee1258e178193141a58a553a256
Author: Martin Schwenke <martin at meltin.net>
Date:   Wed Apr 27 21:44:36 2016 +1000

    ctdb-recoverd: Drop unreachable code
    
    update_local_flags() never returns MONITOR_ELECTION_NEEDED, so drop
    this entire if-statement.
    
    Signed-off-by: Martin Schwenke <martin at meltin.net>
    Reviewed-by: Amitay Isaacs <amitay at gmail.com>

commit e225fbd38c5b665c3f45eda666470a4e54751a6d
Author: Martin Schwenke <martin at meltin.net>
Date:   Wed May 4 16:51:05 2016 +1000

    ctdb-protocol: Drop unused CTDB_SRVID_TAKEOVER_RUN_RESPONSE
    
    Signed-off-by: Martin Schwenke <martin at meltin.net>
    Reviewed-by: Amitay Isaacs <amitay at gmail.com>

commit 4bef374e3142cc81ffe6243f8c9b5e9a0ac60140
Author: Martin Schwenke <martin at meltin.net>
Date:   Sat Apr 23 06:45:01 2016 +1000

    ctdb-daemon: Don't use CTDB_SRVID_TAKEOVER_RUN_RESPONSE
    
    Nobody registers a handler for this message type.
    
    Signed-off-by: Martin Schwenke <martin at meltin.net>
    Reviewed-by: Amitay Isaacs <amitay at gmail.com>

commit 3e272e081f1862b1ed532cbac46aeb839a7a96bd
Author: Martin Schwenke <martin at meltin.net>
Date:   Thu Apr 28 17:11:22 2016 +1000

    ctdb-recover: Avoid duplicate deferred attach processing
    
    Deferred attach processing is done unconditionally at this point.  It
    is then done again if recovery lock checking is done and completes
    successfuly.  If the recovery lock checking fails then it should not
    be done at all.
    
    Move this processing so it is done with the early exit when the
    recovery lock is not being used.
    
    Signed-off-by: Martin Schwenke <martin at meltin.net>
    Reviewed-by: Amitay Isaacs <amitay at gmail.com>

-----------------------------------------------------------------------

Summary of changes:
 ctdb/protocol/protocol.h       |   3 -
 ctdb/protocol/protocol_debug.c |   2 -
 ctdb/server/ctdb_monitor.c     |   2 +-
 ctdb/server/ctdb_recover.c     |   8 +-
 ctdb/server/ctdb_recoverd.c    | 215 +++++++++++++++++++++--------------------
 5 files changed, 112 insertions(+), 118 deletions(-)


Changeset truncated at 500 lines:

diff --git a/ctdb/protocol/protocol.h b/ctdb/protocol/protocol.h
index 64b1fed..7f2ba92 100644
--- a/ctdb/protocol/protocol.h
+++ b/ctdb/protocol/protocol.h
@@ -178,9 +178,6 @@ struct ctdb_call {
 /* SRVID to inform recovery daemon to disable the public ip checks */
 #define CTDB_SRVID_DISABLE_IP_CHECK  0xFC00000000000000LL
 
-/* SRVID to inform recovery daemon of ipreallocate resposnes from ctdbd */
-#define CTDB_SRVID_TAKEOVER_RUN_RESPONSE  0xFD00000000000000LL
-
 /* A range of ports reserved for registering a PID (top 8 bits)
  * All ports matching the 8 top bits are reserved for exclusive use by
  * registering a SRVID that matches the process-id of the requesting process
diff --git a/ctdb/protocol/protocol_debug.c b/ctdb/protocol/protocol_debug.c
index 96c5dde..b86f1c2 100644
--- a/ctdb/protocol/protocol_debug.c
+++ b/ctdb/protocol/protocol_debug.c
@@ -320,8 +320,6 @@ static void ctdb_srvid_print(uint64_t srvid, FILE *fp)
 		fprintf(fp, "DISABLE_RECOVERIES");
 	} else if (srvid == CTDB_SRVID_DISABLE_IP_CHECK) {
 		fprintf(fp, "DISABLE_IP_CHECK");
-	} else if (srvid == CTDB_SRVID_TAKEOVER_RUN_RESPONSE) {
-		fprintf(fp, "TAKEOVER_RUN_RESPONSE");
 	} else if ((srvid & prefix) == CTDB_SRVID_SAMBA_RANGE) {
 		if (srvid == CTDB_SRVID_SAMBA_NOTIFY) {
 			fprintf(fp, "SAMBA_NOTIFY");
diff --git a/ctdb/server/ctdb_monitor.c b/ctdb/server/ctdb_monitor.c
index 0a8273a..1ece7c8 100644
--- a/ctdb/server/ctdb_monitor.c
+++ b/ctdb/server/ctdb_monitor.c
@@ -136,7 +136,7 @@ static void ctdb_health_callback(struct ctdb_context *ctdb, int status, void *p)
 
 	ZERO_STRUCT(rd);
 	rd.pnn   = ctdb->pnn;
-	rd.srvid = CTDB_SRVID_TAKEOVER_RUN_RESPONSE;
+	rd.srvid = 0;
 
 	rddata.dptr = (uint8_t *)&rd;
 	rddata.dsize = sizeof(rd);
diff --git a/ctdb/server/ctdb_recover.c b/ctdb/server/ctdb_recover.c
index e3dbb7c..804dcec 100644
--- a/ctdb/server/ctdb_recover.c
+++ b/ctdb/server/ctdb_recover.c
@@ -901,14 +901,10 @@ int32_t ctdb_control_set_recmode(struct ctdb_context *ctdb,
 		}
 	}
 
-	/* release any deferred attach calls from clients */
-	if (recmode == CTDB_RECOVERY_NORMAL) {
-		ctdb_process_deferred_attach(ctdb);
-	}
-
 	if (ctdb->recovery_lock_file == NULL) {
 		/* Not using recovery lock file */
-		ctdb->recovery_mode = recmode;
+		ctdb->recovery_mode = CTDB_RECOVERY_NORMAL;
+		ctdb_process_deferred_attach(ctdb);
 		return 0;
 	}
 
diff --git a/ctdb/server/ctdb_recoverd.c b/ctdb/server/ctdb_recoverd.c
index a25ad2d..f3fea02 100644
--- a/ctdb/server/ctdb_recoverd.c
+++ b/ctdb/server/ctdb_recoverd.c
@@ -1235,7 +1235,7 @@ static int update_local_flags(struct ctdb_recoverd *rec, struct ctdb_node_map_ol
 				  nodemap->nodes[j].pnn));
 			ctdb_set_culprit(rec, nodemap->nodes[j].pnn);
 			talloc_free(mem_ctx);
-			return MONITOR_FAILED;
+			return -1;
 		}
 		if (nodemap->nodes[j].flags != remote_nodemap->nodes[j].flags) {
 			/* We should tell our daemon about this so it
@@ -1261,7 +1261,7 @@ static int update_local_flags(struct ctdb_recoverd *rec, struct ctdb_node_map_ol
 		talloc_free(remote_nodemap);
 	}
 	talloc_free(mem_ctx);
-	return MONITOR_OK;
+	return 0;
 }
 
 
@@ -3186,86 +3186,117 @@ static bool interfaces_have_changed(struct ctdb_context *ctdb,
 	return ret;
 }
 
-/* called to check that the local allocation of public ip addresses is ok.
-*/
-static int verify_local_ip_allocation(struct ctdb_context *ctdb, struct ctdb_recoverd *rec, uint32_t pnn, struct ctdb_node_map_old *nodemap)
+/* Check that the local allocation of public IP addresses is correct
+ * and do some house-keeping */
+static int verify_local_ip_allocation(struct ctdb_context *ctdb,
+				      struct ctdb_recoverd *rec,
+				      uint32_t pnn,
+				      struct ctdb_node_map_old *nodemap)
 {
 	TALLOC_CTX *mem_ctx = talloc_new(NULL);
 	int ret, j;
 	bool need_takeover_run = false;
+	struct ctdb_public_ip_list_old *ips = NULL;
+
+	/* If we are not the recmaster then do some housekeeping */
+	if (rec->recmaster != pnn) {
+		/* Ignore any IP reallocate requests - only recmaster
+		 * processes them
+		 */
+		TALLOC_FREE(rec->reallocate_requests);
+		/* Clear any nodes that should be force rebalanced in
+		 * the next takeover run.  If the recovery master role
+		 * has moved then we don't want to process these some
+		 * time in the future.
+		 */
+		TALLOC_FREE(rec->force_rebalance_nodes);
+	}
+
+	/* Return early if disabled... */
+	if (ctdb->tunable.disable_ip_failover != 0 ||
+	    ctdb_op_is_disabled(rec->takeover_run)) {
+		return  0;
+	}
 
 	if (interfaces_have_changed(ctdb, rec)) {
-		DEBUG(DEBUG_NOTICE, ("The interfaces status has changed on "
-				     "local node %u - force takeover run\n",
-				     pnn));
 		need_takeover_run = true;
 	}
 
-	/* verify that we have the ip addresses we should have
-	   and we don't have ones we shouldnt have.
-	   if we find an inconsistency we set recmode to
-	   active on the local node and wait for the recmaster
-	   to do a full blown recovery.
-	   also if the pnn is -1 and we are healthy and can host the ip
-	   we also request a ip reallocation.
-	*/
-	if (ctdb->tunable.disable_ip_failover == 0) {
-		struct ctdb_public_ip_list_old *ips = NULL;
+	/* If there are unhosted IPs but this node can host them then
+	 * trigger an IP reallocation */
 
-		/* read the *available* IPs from the local node */
-		ret = ctdb_ctrl_get_public_ips_flags(ctdb, CONTROL_TIMEOUT(), CTDB_CURRENT_NODE, mem_ctx, CTDB_PUBLIC_IP_FLAGS_ONLY_AVAILABLE, &ips);
-		if (ret != 0) {
-			DEBUG(DEBUG_ERR, ("Unable to get available public IPs from local node %u\n", pnn));
-			talloc_free(mem_ctx);
-			return -1;
-		}
+	/* Read *available* IPs from local node */
+	ret = ctdb_ctrl_get_public_ips_flags(
+		ctdb, CONTROL_TIMEOUT(), CTDB_CURRENT_NODE, mem_ctx,
+		CTDB_PUBLIC_IP_FLAGS_ONLY_AVAILABLE, &ips);
+	if (ret != 0) {
+		DEBUG(DEBUG_ERR, ("Unable to retrieve available public IPs\n"));
+		talloc_free(mem_ctx);
+		return -1;
+	}
 
-		for (j=0; j<ips->num; j++) {
-			if (ips->ips[j].pnn == -1 &&
-			    nodemap->nodes[pnn].flags == 0) {
-				DEBUG(DEBUG_CRIT,("Public IP '%s' is not assigned and we could serve it\n",
-						  ctdb_addr_to_str(&ips->ips[j].addr)));
-				need_takeover_run = true;
-			}
+	for (j=0; j<ips->num; j++) {
+		if (ips->ips[j].pnn == -1 &&
+		    nodemap->nodes[pnn].flags == 0) {
+			DEBUG(DEBUG_WARNING,
+			      ("Unassigned IP %s can be served by this node\n",
+			       ctdb_addr_to_str(&ips->ips[j].addr)));
+			need_takeover_run = true;
 		}
+	}
 
-		talloc_free(ips);
+	talloc_free(ips);
 
-		/* read the *known* IPs from the local node */
-		ret = ctdb_ctrl_get_public_ips_flags(ctdb, CONTROL_TIMEOUT(), CTDB_CURRENT_NODE, mem_ctx, 0, &ips);
-		if (ret != 0) {
-			DEBUG(DEBUG_ERR, ("Unable to get known public IPs from local node %u\n", pnn));
-			talloc_free(mem_ctx);
-			return -1;
-		}
+	if (!ctdb->do_checkpublicip) {
+		goto done;
+	}
 
-		for (j=0; j<ips->num; j++) {
-			if (ips->ips[j].pnn == pnn) {
-				if (ctdb->do_checkpublicip && !ctdb_sys_have_ip(&ips->ips[j].addr)) {
-					DEBUG(DEBUG_CRIT,("Public IP '%s' is assigned to us but not on an interface\n",
-						ctdb_addr_to_str(&ips->ips[j].addr)));
-					need_takeover_run = true;
-				}
-			} else {
-				if (ctdb->do_checkpublicip &&
-				    ctdb_sys_have_ip(&ips->ips[j].addr)) {
+	/* Validate the IP addresses that this node has on network
+	 * interfaces.  If there is an inconsistency between reality
+	 * and the state expected by CTDB then try to fix it by
+	 * triggering an IP reallocation or releasing extraneous IP
+	 * addresses. */
 
-					DEBUG(DEBUG_CRIT,("We are still serving a public IP '%s' that we should not be serving. Removing it\n", 
-						ctdb_addr_to_str(&ips->ips[j].addr)));
+	/* Read *known* IPs from local node */
+	ret = ctdb_ctrl_get_public_ips_flags(
+		ctdb, CONTROL_TIMEOUT(), CTDB_CURRENT_NODE, mem_ctx, 0, &ips);
+	if (ret != 0) {
+		DEBUG(DEBUG_ERR, ("Unable to retrieve known public IPs\n"));
+		talloc_free(mem_ctx);
+		return -1;
+	}
 
-					if (ctdb_ctrl_release_ip(ctdb, CONTROL_TIMEOUT(), CTDB_CURRENT_NODE, &ips->ips[j]) != 0) {
-						DEBUG(DEBUG_ERR,("Failed to release local IP address\n"));
-					}
+	for (j=0; j<ips->num; j++) {
+		if (ips->ips[j].pnn == pnn) {
+			if (!ctdb_sys_have_ip(&ips->ips[j].addr)) {
+				DEBUG(DEBUG_ERR,
+				      ("Assigned IP %s not on an interface\n",
+				       ctdb_addr_to_str(&ips->ips[j].addr)));
+				need_takeover_run = true;
+			}
+		} else {
+			if (ctdb_sys_have_ip(&ips->ips[j].addr)) {
+				DEBUG(DEBUG_ERR,
+				      ("IP %s incorrectly on an interface - releasing\n",
+				       ctdb_addr_to_str(&ips->ips[j].addr)));
+				ret = ctdb_ctrl_release_ip(ctdb,
+							   CONTROL_TIMEOUT(),
+							   CTDB_CURRENT_NODE,
+							   &ips->ips[j]);
+				if (ret != 0) {
+					DEBUG(DEBUG_ERR,
+					      ("Failed to release IP address\n"));
 				}
 			}
 		}
 	}
 
+done:
 	if (need_takeover_run) {
 		struct ctdb_srvid_message rd;
 		TDB_DATA data;
 
-		DEBUG(DEBUG_CRIT,("Trigger takeoverrun\n"));
+		DEBUG(DEBUG_NOTICE,("Trigger takeoverrun\n"));
 
 		ZERO_STRUCT(rd);
 		rd.pnn = ctdb->pnn;
@@ -3275,7 +3306,8 @@ static int verify_local_ip_allocation(struct ctdb_context *ctdb, struct ctdb_rec
 
 		ret = ctdb_client_send_message(ctdb, rec->recmaster, CTDB_SRVID_TAKEOVER_RUN, data);
 		if (ret != 0) {
-			DEBUG(DEBUG_ERR,(__location__ " Failed to send ipreallocate to recmaster :%d\n", (int)rec->recmaster));
+			DEBUG(DEBUG_ERR,
+			      ("Failed to send takeover run request\n"));
 		}
 	}
 	talloc_free(mem_ctx);
@@ -3364,8 +3396,8 @@ static int update_recovery_lock_file(struct ctdb_context *ctdb)
 	return 0;
 }
 
-static enum monitor_result validate_recovery_master(struct ctdb_recoverd *rec,
-						    TALLOC_CTX *mem_ctx)
+static bool validate_recovery_master(struct ctdb_recoverd *rec,
+				     TALLOC_CTX *mem_ctx)
 {
 	struct ctdb_context *ctdb = rec->ctdb;
 	uint32_t pnn = ctdb_get_pnn(ctdb);
@@ -3379,7 +3411,8 @@ static enum monitor_result validate_recovery_master(struct ctdb_recoverd *rec,
 	if (rec->recmaster == CTDB_UNKNOWN_PNN) {
 		DEBUG(DEBUG_NOTICE,
 		      ("Initial recovery master set - forcing election\n"));
-		return MONITOR_ELECTION_NEEDED;
+		force_election(rec, pnn, nodemap);
+		return false;
 	}
 
 	/*
@@ -3396,7 +3429,8 @@ static enum monitor_result validate_recovery_master(struct ctdb_recoverd *rec,
 		      (" Current recmaster node %u does not have CAP_RECMASTER,"
 		       " but we (node %u) have - force an election\n",
 		       rec->recmaster, pnn));
-		return MONITOR_ELECTION_NEEDED;
+		force_election(rec, pnn, nodemap);
+		return false;
 	}
 
 	/* Verify that the master node has not been deleted.  This
@@ -3409,7 +3443,8 @@ static enum monitor_result validate_recovery_master(struct ctdb_recoverd *rec,
 		DEBUG(DEBUG_ERR,
 		      ("Recmaster node %u has been deleted. Force election\n",
 		       rec->recmaster));
-		return MONITOR_ELECTION_NEEDED;
+		force_election(rec, pnn, nodemap);
+		return false;
 	}
 
 	/* if recovery master is disconnected/deleted we must elect a new recmaster */
@@ -3418,7 +3453,8 @@ static enum monitor_result validate_recovery_master(struct ctdb_recoverd *rec,
 		DEBUG(DEBUG_NOTICE,
 		      ("Recmaster node %u is disconnected/deleted. Force election\n",
 		       rec->recmaster));
-		return MONITOR_ELECTION_NEEDED;
+		force_election(rec, pnn, nodemap);
+		return false;
 	}
 
 	/* get nodemap from the recovery master to check if it is inactive */
@@ -3429,7 +3465,8 @@ static enum monitor_result validate_recovery_master(struct ctdb_recoverd *rec,
 		      (__location__
 		       " Unable to get nodemap from recovery master %u\n",
 			  rec->recmaster));
-		return MONITOR_FAILED;
+		/* No election, just error */
+		return false;
 	}
 
 
@@ -3445,10 +3482,11 @@ static enum monitor_result validate_recovery_master(struct ctdb_recoverd *rec,
 		 */
 		nodemap->nodes[rec->recmaster].flags =
 			recmaster_nodemap->nodes[rec->recmaster].flags;
-		return MONITOR_ELECTION_NEEDED;
+		force_election(rec, pnn, nodemap);
+		return false;
 	}
 
-	return MONITOR_OK;
+	return true;
 }
 
 static void main_loop(struct ctdb_context *ctdb, struct ctdb_recoverd *rec,
@@ -3567,20 +3605,6 @@ static void main_loop(struct ctdb_context *ctdb, struct ctdb_recoverd *rec,
 		return;
 	}
 
-	/* If we are not the recmaster then do some housekeeping */
-	if (rec->recmaster != pnn) {
-		/* Ignore any IP reallocate requests - only recmaster
-		 * processes them
-		 */
-		TALLOC_FREE(rec->reallocate_requests);
-		/* Clear any nodes that should be force rebalanced in
-		 * the next takeover run.  If the recovery master role
-		 * has moved then we don't want to process these some
-		 * time in the future.
-		 */
-		TALLOC_FREE(rec->force_rebalance_nodes);
-	}
-
 	/* Retrieve capabilities from all connected nodes */
 	ret = update_capabilities(rec, nodemap);
 	if (ret != 0) {
@@ -3588,29 +3612,13 @@ static void main_loop(struct ctdb_context *ctdb, struct ctdb_recoverd *rec,
 		return;
 	}
 
-	switch (validate_recovery_master(rec, mem_ctx)) {
-	case MONITOR_RECOVERY_NEEDED:
-		/* can not happen */
-		return;
-	case MONITOR_ELECTION_NEEDED:
-		force_election(rec, pnn, nodemap);
-		return;
-	case MONITOR_OK:
-		break;
-	case MONITOR_FAILED:
+	if (! validate_recovery_master(rec, mem_ctx)) {
 		return;
 	}
 
-	/* verify that we have all ip addresses we should have and we dont
-	 * have addresses we shouldnt have.
-	 */ 
-	if (ctdb->tunable.disable_ip_failover == 0 &&
-	    !ctdb_op_is_disabled(rec->takeover_run)) {
-		if (verify_local_ip_allocation(ctdb, rec, pnn, nodemap) != 0) {
-			DEBUG(DEBUG_ERR, (__location__ " Public IPs were inconsistent.\n"));
-		}
-	}
-
+	/* Check if an IP takeover run is needed and trigger one if
+	 * necessary */
+	verify_local_ip_allocation(ctdb, rec, pnn, nodemap);
 
 	/* if we are not the recmaster then we do not need to check
 	   if recovery is needed
@@ -3622,12 +3630,7 @@ static void main_loop(struct ctdb_context *ctdb, struct ctdb_recoverd *rec,
 
 	/* ensure our local copies of flags are right */
 	ret = update_local_flags(rec, nodemap);
-	if (ret == MONITOR_ELECTION_NEEDED) {
-		DEBUG(DEBUG_NOTICE,("update_local_flags() called for a re-election.\n"));
-		force_election(rec, pnn, nodemap);
-		return;
-	}
-	if (ret != MONITOR_OK) {
+	if (ret != 0) {
 		DEBUG(DEBUG_ERR,("Unable to update local flags\n"));
 		return;
 	}


-- 
Samba Shared Repository



More information about the samba-cvs mailing list