summaryrefslogtreecommitdiff
path: root/ctdb/server/ctdb_recover.c
diff options
context:
space:
mode:
authorMartin Schwenke <martin@meltin.net>2016-01-11 13:58:54 +1100
committerAmitay Isaacs <amitay@samba.org>2016-02-23 07:23:18 +0100
commit531e6724ba9d0a4fab2dca40344e4c7be3e966c1 (patch)
treee90bea67f6c9b5d33cfb10dbb5a0b88e82926dbc /ctdb/server/ctdb_recover.c
parent6695fa50aed43ad2b2998197ae79fa768f5a89d7 (diff)
downloadsamba-531e6724ba9d0a4fab2dca40344e4c7be3e966c1.tar.gz
ctdb-recovery: Don't store recmode in recovery mode state
The callbacks that use this value are only ever called if recovery mode is being set to NORMAL. So do not check if recmode is NORMAL either. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
Diffstat (limited to 'ctdb/server/ctdb_recover.c')
-rw-r--r--ctdb/server/ctdb_recover.c15
1 files changed, 7 insertions, 8 deletions
diff --git a/ctdb/server/ctdb_recover.c b/ctdb/server/ctdb_recover.c
index 7411dd26a1d..4e6171ab1b3 100644
--- a/ctdb/server/ctdb_recover.c
+++ b/ctdb/server/ctdb_recover.c
@@ -410,7 +410,6 @@ failed:
struct ctdb_set_recmode_state {
struct ctdb_context *ctdb;
struct ctdb_req_control_old *c;
- uint32_t recmode;
int fd[2];
struct tevent_timer *te;
struct tevent_fd *fde;
@@ -435,7 +434,7 @@ static void ctdb_set_recmode_timeout(struct tevent_context *ev,
arbitrate locks immediately after a node failure.
*/
DEBUG(DEBUG_ERR,(__location__ " set_recmode child process hung/timedout CFS slow to grant locks? (allowing recmode set anyway)\n"));
- state->ctdb->recovery_mode = state->recmode;
+ state->ctdb->recovery_mode = CTDB_RECOVERY_NORMAL;
ctdb_request_control_reply(state->ctdb, state->c, NULL, 0, NULL);
talloc_free(state);
}
@@ -493,12 +492,10 @@ static void set_recmode_handler(struct tevent_context *ev,
return;
}
- state->ctdb->recovery_mode = state->recmode;
+ state->ctdb->recovery_mode = CTDB_RECOVERY_NORMAL;
/* release any deferred attach calls from clients */
- if (state->recmode == CTDB_RECOVERY_NORMAL) {
- ctdb_process_deferred_attach(state->ctdb);
- }
+ ctdb_process_deferred_attach(state->ctdb);
ctdb_request_control_reply(state->ctdb, state->c, NULL, 0, NULL);
talloc_free(state);
@@ -573,7 +570,10 @@ int32_t ctdb_control_set_recmode(struct ctdb_context *ctdb,
return 0;
}
- /* some special handling when ending recovery mode */
+ /* From this point: recmode == CTDB_RECOVERY_NORMAL
+ *
+ * Therefore, what follows is special handling when setting
+ * recovery mode back to normal */
for (ctdb_db = ctdb->db_list; ctdb_db != NULL; ctdb_db = ctdb_db->next) {
if (ctdb_db->generation != ctdb->vnn_map->generation) {
@@ -672,7 +672,6 @@ int32_t ctdb_control_set_recmode(struct ctdb_context *ctdb,
tevent_fd_set_auto_close(state->fde);
state->ctdb = ctdb;
- state->recmode = recmode;
state->c = talloc_steal(state, c);
*async_reply = true;