The branch, v4-6-test has been updated
       via  f10ce74 ctdb-recovery: Do not run local ip verification when in 
recovery
       via  9f25dff ctdb-recovery: Get recmode unconditionally in the main_loop
       via  59ac9bf ctdb-recovery: Finish processing for recovery mode ACTIVE 
first
       via  7ee7e65 ctdb-recovery: Simplify logging of recovery mode setting
       via  89ee737 ctdb-recovery: Setting up of recmode should be idempotent
       via  a227893 ctdb-recovery: Assign banning credits if database fails to 
freeze
       via  6e11262 ctdb-scripts: Don't send empty argument string to logger
      from  9670a0d Bug 15852. There are valid paths where 
conn->lsa_pipe_tcp->transport is NULL. Protect against this.

https://git.samba.org/?p=samba.git;a=shortlog;h=v4-6-test


- Log -----------------------------------------------------------------
commit f10ce74c333d1943e58456b600eac6eefb1767bb
Author: Amitay Isaacs <[email protected]>
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 <[email protected]>
    Reviewed-by: Martin Schwenke <[email protected]>
    (cherry picked from commit ea46699b27ef8d4ac7b5dd07035465cb3df09ea4)
    
    Autobuild-User(v4-6-test): Karolin Seeger <[email protected]>
    Autobuild-Date(v4-6-test): Mon Jun 26 16:51:56 CEST 2017 on sn-devel-144

commit 9f25dffb4f2370888a20ce4d7d988bed99c1e676
Author: Amitay Isaacs <[email protected]>
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 <[email protected]>
    Reviewed-by: Martin Schwenke <[email protected]>
    (cherry picked from commit 2fd2ccd4c8617cfa7374d7a5ee3d1cc61c4fa4ad)

commit 59ac9bfe6006a4e8596771af2c7ff3bf4512f4f4
Author: Amitay Isaacs <[email protected]>
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 <[email protected]>
    Reviewed-by: Martin Schwenke <[email protected]>
    (cherry picked from commit f8200153b21f5b19c9a1d57be3e05e739d9fafcd)

commit 7ee7e65f5212adefc5ea9351e30c6487b83dd0f1
Author: Amitay Isaacs <[email protected]>
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 <[email protected]>
    Reviewed-by: Martin Schwenke <[email protected]>
    (cherry picked from commit d74dadd7f26a9e8c48ba92468d7d0c4a7aa5a8e5)

commit 89ee737cd41d49855f881d519f6736cfeaba9178
Author: Amitay Isaacs <[email protected]>
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 <[email protected]>
    Reviewed-by: Martin Schwenke <[email protected]>
    (cherry picked from commit f2771fcbf438e8b06321752c7203f01bbe33b573)

commit a227893188bbf5c68dcf923d42ccd20ae366009a
Author: Amitay Isaacs <[email protected]>
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 <[email protected]>
    Reviewed-by: Martin Schwenke <[email protected]>
    (cherry picked from commit c9d9f56bffe1e19665dba8e0cf899399d3d9fb72)

commit 6e11262d60bfbc8e053de10a188beed52dd6d90a
Author: Amitay Isaacs <[email protected]>
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 <[email protected]>
    Reviewed-by: Martin Schwenke <[email protected]>
    
    Autobuild-User(master): Martin Schwenke <[email protected]>
    Autobuild-Date(master): Sat Jun 24 14:37:48 CEST 2017 on sn-devel-144
    
    (cherry picked from commit 2fa069e870c0e6f1daa2a08be5aacac7b1063a5e)

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

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 7e37bbb..3826324 100755
--- a/ctdb/config/functions
+++ b/ctdb/config/functions
@@ -150,7 +150,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 9ea0f61..d9cc4a2 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 0222aa0..474b900 100644
--- a/ctdb/server/ctdb_recovery_helper.c
+++ b/ctdb/server/ctdb_recovery_helper.c
@@ -1627,6 +1627,7 @@ static void recover_db_freeze_done(struct tevent_req 
*subreq)
                if (ret2 != 0) {
                        LOG("control FREEZE_DB failed for db %s on node %u,"
                            " ret=%d\n", state->db_name, pnn, ret2);
+                       state->ban_credits[pnn] += 1;
                } else {
                        LOG("control FREEZE_DB failed for db %s, ret=%d\n",
                            state->db_name, ret);


-- 
Samba Shared Repository

Reply via email to