[SCM] Samba Shared Repository - branch master updated

Martin Schwenke martins at samba.org
Sat Jun 24 12:38:03 UTC 2017


The branch, master has been updated
       via  2fa069e ctdb-scripts: Don't send empty argument string to logger
       via  ea46699 ctdb-recovery: Do not run local ip verification when in recovery
       via  2fd2ccd ctdb-recovery: Get recmode unconditionally in the main_loop
       via  f820015 ctdb-recovery: Finish processing for recovery mode ACTIVE first
       via  d74dadd ctdb-recovery: Simplify logging of recovery mode setting
       via  f2771fc ctdb-recovery: Setting up of recmode should be idempotent
       via  c9d9f56 ctdb-recovery: Assign banning credits if database fails to freeze
      from  38581bc lib: Use ctdb_protocol instead of ctdb_private

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


- Log -----------------------------------------------------------------
commit 2fa069e870c0e6f1daa2a08be5aacac7b1063a5e
Author: Amitay Isaacs <amitay at gmail.com>
Date:   Thu Jun 22 14:34:36 2017 +1000

    ctdb-scripts: Don't send empty argument string to logger
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=12856
    
    This stops logger reading from stdin.
    
    Signed-off-by: Amitay Isaacs <amitay at gmail.com>
    Reviewed-by: Martin Schwenke <martin at meltin.net>
    
    Autobuild-User(master): Martin Schwenke <martins at samba.org>
    Autobuild-Date(master): Sat Jun 24 14:37:48 CEST 2017 on sn-devel-144

commit ea46699b27ef8d4ac7b5dd07035465cb3df09ea4
Author: Amitay Isaacs <amitay at gmail.com>
Date:   Thu Jun 22 16:15:47 2017 +1000

    ctdb-recovery: Do not run local ip verification when in recovery
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=12857
    
    If we drop public IPs because CTDB is in recovery for too long, then
    avoid spamming logs "Trigger takeoverrun" every second.
    
    Signed-off-by: Amitay Isaacs <amitay at gmail.com>
    Reviewed-by: Martin Schwenke <martin at meltin.net>

commit 2fd2ccd4c8617cfa7374d7a5ee3d1cc61c4fa4ad
Author: Amitay Isaacs <amitay at gmail.com>
Date:   Thu Jun 22 17:45:20 2017 +1000

    ctdb-recovery: Get recmode unconditionally in the main_loop
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=12857
    
    This can be used later in the main_loop to avoid the local ip check.
    
    Signed-off-by: Amitay Isaacs <amitay at gmail.com>
    Reviewed-by: Martin Schwenke <martin at meltin.net>

commit f8200153b21f5b19c9a1d57be3e05e739d9fafcd
Author: Amitay Isaacs <amitay at gmail.com>
Date:   Thu Jun 22 14:09:32 2017 +1000

    ctdb-recovery: Finish processing for recovery mode ACTIVE first
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=12857
    
    This simplifies the code and avoids complicated conditions.
    
    Signed-off-by: Amitay Isaacs <amitay at gmail.com>
    Reviewed-by: Martin Schwenke <martin at meltin.net>

commit d74dadd7f26a9e8c48ba92468d7d0c4a7aa5a8e5
Author: Amitay Isaacs <amitay at gmail.com>
Date:   Thu Jun 22 14:52:32 2017 +1000

    ctdb-recovery: Simplify logging of recovery mode setting
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=12857
    
    Signed-off-by: Amitay Isaacs <amitay at gmail.com>
    Reviewed-by: Martin Schwenke <martin at meltin.net>

commit f2771fcbf438e8b06321752c7203f01bbe33b573
Author: Amitay Isaacs <amitay at gmail.com>
Date:   Thu Jun 22 14:49:02 2017 +1000

    ctdb-recovery: Setting up of recmode should be idempotent
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=12857
    
    If the recovery mode is already set to the expected value, there is
    nothing to do.
    
    Signed-off-by: Amitay Isaacs <amitay at gmail.com>
    Reviewed-by: Martin Schwenke <martin at meltin.net>

commit c9d9f56bffe1e19665dba8e0cf899399d3d9fb72
Author: Amitay Isaacs <amitay at gmail.com>
Date:   Thu Jun 22 14:00:13 2017 +1000

    ctdb-recovery: Assign banning credits if database fails to freeze
    
    https://bugzilla.samba.org/show_bug.cgi?id=12857
    
    Signed-off-by: Amitay Isaacs <amitay at gmail.com>
    Reviewed-by: Martin Schwenke <martin at meltin.net>

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

Summary of changes:
 ctdb/config/functions              |  2 +-
 ctdb/server/ctdb_recover.c         | 28 ++++++++++++++--------------
 ctdb/server/ctdb_recoverd.c        | 19 ++++++++++++-------
 ctdb/server/ctdb_recovery_helper.c |  1 +
 4 files changed, 28 insertions(+), 22 deletions(-)


Changeset truncated at 500 lines:

diff --git a/ctdb/config/functions b/ctdb/config/functions
index 2c630bd..5df52c2 100755
--- a/ctdb/config/functions
+++ b/ctdb/config/functions
@@ -130,7 +130,7 @@ script_log ()
 	*)
 	    # Handle all syslog:* variants here too.  There's no tool to do
 	    # the lossy things, so just use logger.
-	    logger -t "ctdbd: ${_tag}" "$*"
+	    logger -t "ctdbd: ${_tag}" "$@"
 	    ;;
     esac
 }
diff --git a/ctdb/server/ctdb_recover.c b/ctdb/server/ctdb_recover.c
index 6bed61c..813a1ad 100644
--- a/ctdb/server/ctdb_recover.c
+++ b/ctdb/server/ctdb_recover.c
@@ -856,26 +856,24 @@ int32_t ctdb_control_set_recmode(struct ctdb_context *ctdb,
 	struct set_recmode_state *state;
 	struct ctdb_cluster_mutex_handle *h;
 
+	if (recmode == ctdb->recovery_mode) {
+		D_INFO("Recovery mode already set to %s\n",
+		       recmode == CTDB_RECOVERY_NORMAL ? "NORMAL" : "ACTIVE");
+		return 0;
+	}
+
+	D_NOTICE("Recovery mode set to %s\n",
+		 recmode == CTDB_RECOVERY_NORMAL ? "NORMAL" : "ACTIVE");
+
 	/* if we enter recovery but stay in recovery for too long
 	   we will eventually drop all our ip addresses
 	*/
-	if (recmode == CTDB_RECOVERY_NORMAL) {
-		talloc_free(ctdb->release_ips_ctx);
-		ctdb->release_ips_ctx = NULL;
-	} else {
+	if (recmode == CTDB_RECOVERY_ACTIVE) {
 		if (ctdb_deferred_drop_all_ips(ctdb) != 0) {
-			DEBUG(DEBUG_ERR,("Failed to set up deferred drop all ips\n"));
+			D_ERR("Failed to set up deferred drop all ips\n");
 		}
-	}
 
-	if (recmode != ctdb->recovery_mode) {
-		DEBUG(DEBUG_NOTICE,(__location__ " Recovery mode set to %s\n", 
-			 recmode==CTDB_RECOVERY_NORMAL?"NORMAL":"ACTIVE"));
-	}
-
-	if (recmode != CTDB_RECOVERY_NORMAL ||
-	    ctdb->recovery_mode != CTDB_RECOVERY_ACTIVE) {
-		ctdb->recovery_mode = recmode;
+		ctdb->recovery_mode = CTDB_RECOVERY_ACTIVE;
 		return 0;
 	}
 
@@ -884,6 +882,8 @@ int32_t ctdb_control_set_recmode(struct ctdb_context *ctdb,
 	 * Therefore, what follows is special handling when setting
 	 * recovery mode back to normal */
 
+	TALLOC_FREE(ctdb->release_ips_ctx);
+
 	for (ctdb_db = ctdb->db_list; ctdb_db != NULL; ctdb_db = ctdb_db->next) {
 		if (ctdb_db->generation != ctdb->vnn_map->generation) {
 			DEBUG(DEBUG_ERR,
diff --git a/ctdb/server/ctdb_recoverd.c b/ctdb/server/ctdb_recoverd.c
index 751a08e..8471000 100644
--- a/ctdb/server/ctdb_recoverd.c
+++ b/ctdb/server/ctdb_recoverd.c
@@ -2608,6 +2608,13 @@ static void main_loop(struct ctdb_context *ctdb, struct ctdb_recoverd *rec,
 		return;
 	}
 
+	ret = ctdb_ctrl_getrecmode(ctdb, mem_ctx, CONTROL_TIMEOUT(),
+				   CTDB_CURRENT_NODE, &ctdb->recovery_mode);
+	if (ret != 0) {
+		D_ERR("Failed to read recmode from local node\n");
+		return;
+	}
+
 	/* if the local daemon is STOPPED or BANNED, we verify that the databases are
 	   also frozen and that the recmode is set to active.
 	*/
@@ -2620,10 +2627,6 @@ static void main_loop(struct ctdb_context *ctdb, struct ctdb_recoverd *rec,
 		 */
 		rec->priority_time = timeval_current();
 
-		ret = ctdb_ctrl_getrecmode(ctdb, mem_ctx, CONTROL_TIMEOUT(), CTDB_CURRENT_NODE, &ctdb->recovery_mode);
-		if (ret != 0) {
-			DEBUG(DEBUG_ERR,(__location__ " Failed to read recmode from local node\n"));
-		}
 		if (ctdb->recovery_mode == CTDB_RECOVERY_NORMAL) {
 			DEBUG(DEBUG_ERR,("Node is stopped or banned but recovery mode is not active. Activate recovery mode and lock databases\n"));
 
@@ -2667,9 +2670,11 @@ static void main_loop(struct ctdb_context *ctdb, struct ctdb_recoverd *rec,
 		return;
 	}
 
-	/* Check if an IP takeover run is needed and trigger one if
-	 * necessary */
-	verify_local_ip_allocation(ctdb, rec, pnn, nodemap);
+	if (ctdb->recovery_mode == CTDB_RECOVERY_NORMAL) {
+		/* 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
diff --git a/ctdb/server/ctdb_recovery_helper.c b/ctdb/server/ctdb_recovery_helper.c
index b882da0..4739da7 100644
--- a/ctdb/server/ctdb_recovery_helper.c
+++ b/ctdb/server/ctdb_recovery_helper.c
@@ -1604,6 +1604,7 @@ static void recover_db_freeze_done(struct tevent_req *subreq)
 			D_ERR("control FREEZE_DB failed for db %s"
 			      " on node %u, ret=%d\n",
 			      state->db_name, pnn, ret2);
+			state->ban_credits[pnn] += 1;
 		} else {
 			D_ERR("control FREEZE_DB failed for db %s, ret=%d\n",
 			      state->db_name, ret);


-- 
Samba Shared Repository



More information about the samba-cvs mailing list