summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Adam <obnox@samba.org>2011-02-22 22:44:16 +0100
committerMichael Adam <obnox@samba.org>2011-02-24 10:35:24 +0100
commit033ba0b466942349295f17e0f3d7b84aabb2c39f (patch)
treec6160f50425371f93353cc060d14b4249fdf7a71
parent0c93a2932c0641b6ba22977483f464e21fe915df (diff)
downloadsamba-033ba0b466942349295f17e0f3d7b84aabb2c39f.tar.gz
samba-033ba0b466942349295f17e0f3d7b84aabb2c39f.tar.xz
samba-033ba0b466942349295f17e0f3d7b84aabb2c39f.zip
persistent: if a node failed to update_record, trigger a recovery
and stop processing of the update_record replies in order to let the recovery finish the trans3_commit control. (This used to be ctdb commit cab95570dc1eefb08abbac5ae411c29f699b51cc)
-rw-r--r--ctdb/server/ctdb_persistent.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/ctdb/server/ctdb_persistent.c b/ctdb/server/ctdb_persistent.c
index cde3365053..5733290852 100644
--- a/ctdb/server/ctdb_persistent.c
+++ b/ctdb/server/ctdb_persistent.c
@@ -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;