persistent: if a node failed to update_record, trigger a recovery
authorMichael Adam <obnox@samba.org>
Tue, 22 Feb 2011 21:44:16 +0000 (22:44 +0100)
committerMichael Adam <obnox@samba.org>
Thu, 24 Feb 2011 09:31:59 +0000 (10:31 +0100)
and stop processing of the update_record replies in order to let
the recovery finish the trans3_commit control.

server/ctdb_persistent.c

index cde3365053c1a8e1240f8754590e2440df4f1c4d..573329085298a2e76f616750c6d20db339cf384c 100644 (file)
@@ -65,7 +65,18 @@ static void ctdb_persistent_callback(struct ctdb_context *ctdb,
                state->status = status;
                state->errormsg = errormsg;
                state->num_failed++;
+
+               /*
+                * If a node failed to complete the update_record control,
+                * then either a recovery is already running or something
+                * bad is going on. So trigger a recovery and let the
+                * recovery finish the transaction, sending back the reply
+                * for the trans3_commit control to the client.
+                */
+               ctdb->recovery_mode = CTDB_RECOVERY_ACTIVE;
+               return;
        }
+
        state->num_pending--;
        if (state->num_pending == 0) {
                enum ctdb_trans2_commit_error etype;