From c1039fba0e1d6531ff11c0a352c4564bda3f4906 Mon Sep 17 00:00:00 2001 From: Michael Adam Date: Fri, 4 Dec 2009 00:06:34 +0100 Subject: [PATCH] server:trans2_commit: move the check for active recovery down. This needs to be done after the control-dispatcher: In the TRANS2_COMMIT control, the client->db_id needs to be set before bailing out, since otherwise the next TRANS2_COMMIT_RETRY will fail... Michael (This used to be ctdb commit 59faf3f923a5989b5ee94ef02a12827412775bae) --- ctdb/server/ctdb_persistent.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/ctdb/server/ctdb_persistent.c b/ctdb/server/ctdb_persistent.c index 02ca7c8d9ca..7fc45877f3b 100644 --- a/ctdb/server/ctdb_persistent.c +++ b/ctdb/server/ctdb_persistent.c @@ -105,11 +105,6 @@ int32_t ctdb_control_trans2_commit(struct ctdb_context *ctdb, struct ctdb_marshall_buffer *m = (struct ctdb_marshall_buffer *)recdata.dptr; struct ctdb_db_context *ctdb_db; - if (ctdb->recovery_mode != CTDB_RECOVERY_NORMAL) { - DEBUG(DEBUG_INFO,("rejecting ctdb_control_trans2_commit when recovery active\n")); - return -1; - } - ctdb_db = find_ctdb_db(ctdb, m->db_id); if (ctdb_db == NULL) { DEBUG(DEBUG_ERR,(__location__ " ctdb_control_trans2_commit: " @@ -189,6 +184,11 @@ int32_t ctdb_control_trans2_commit(struct ctdb_context *ctdb, break; } + if (ctdb->recovery_mode != CTDB_RECOVERY_NORMAL) { + DEBUG(DEBUG_INFO,("rejecting ctdb_control_trans2_commit when recovery active\n")); + return -1; + } + state = talloc_zero(ctdb, struct ctdb_persistent_state); CTDB_NO_MEMORY(ctdb, state);