diff options
author | Amitay Isaacs <amitay@gmail.com> | 2017-06-22 14:09:32 +1000 |
---|---|---|
committer | Martin Schwenke <martins@samba.org> | 2017-06-24 10:28:21 +0200 |
commit | f8200153b21f5b19c9a1d57be3e05e739d9fafcd (patch) | |
tree | 28b27cf561bae32dae5667b2fbb05706d4a2ec94 /ctdb/server/ctdb_recover.c | |
parent | d74dadd7f26a9e8c48ba92468d7d0c4a7aa5a8e5 (diff) | |
download | samba-f8200153b21f5b19c9a1d57be3e05e739d9fafcd.tar.gz |
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@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
Diffstat (limited to 'ctdb/server/ctdb_recover.c')
-rw-r--r-- | ctdb/server/ctdb_recover.c | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/ctdb/server/ctdb_recover.c b/ctdb/server/ctdb_recover.c index e35ba737eba..813a1adbb54 100644 --- a/ctdb/server/ctdb_recover.c +++ b/ctdb/server/ctdb_recover.c @@ -868,18 +868,12 @@ int32_t ctdb_control_set_recmode(struct ctdb_context *ctdb, /* 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_NORMAL || - ctdb->recovery_mode != CTDB_RECOVERY_ACTIVE) { - ctdb->recovery_mode = recmode; + ctdb->recovery_mode = CTDB_RECOVERY_ACTIVE; return 0; } @@ -888,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, |