[SCM] CTDB repository - branch master updated - c76c214be401cb116265ed17ffe6c77c979ded82

Andrew Tridgell tridge at samba.org
Thu Aug 7 03:35:02 GMT 2008


The branch, master has been updated
       via  c76c214be401cb116265ed17ffe6c77c979ded82 (commit)
      from  b6d9a0396fb4b325778d3810dc656f719f31b9f1 (commit)

http://gitweb.samba.org/?p=tridge/ctdb.git;a=shortlog;h=master


- Log -----------------------------------------------------------------
commit c76c214be401cb116265ed17ffe6c77c979ded82
Author: Andrew Tridgell <tridge at samba.org>
Date:   Thu Aug 7 13:34:18 2008 +1000

    cover some corner cases where the persistent database could become
    inconsistent

-----------------------------------------------------------------------

Summary of changes:
 client/ctdb_client.c     |    3 +++
 server/ctdb_persistent.c |    6 ++++--
 2 files changed, 7 insertions(+), 2 deletions(-)


Changeset truncated at 500 lines:

diff --git a/client/ctdb_client.c b/client/ctdb_client.c
index 48eb19d..cec16d1 100644
--- a/client/ctdb_client.c
+++ b/client/ctdb_client.c
@@ -3235,6 +3235,9 @@ again:
 		sleep(1);
 		if (ctdb_replay_transaction(h) != 0) {
 			DEBUG(DEBUG_ERR,(__location__ " Failed to replay transaction\n"));
+			ctdb_control(ctdb, CTDB_CURRENT_NODE, h->ctdb_db->db_id, 
+				     CTDB_CONTROL_TRANS2_ERROR, CTDB_CTRL_FLAG_NOREPLY, 
+				     tdb_null, NULL, NULL, NULL, NULL, NULL);		
 			talloc_free(h);
 			return -1;
 		}
diff --git a/server/ctdb_persistent.c b/server/ctdb_persistent.c
index 77cff9c..6a8a100 100644
--- a/server/ctdb_persistent.c
+++ b/server/ctdb_persistent.c
@@ -463,6 +463,8 @@ int32_t ctdb_control_trans2_finished(struct ctdb_context *ctdb,
 
 	if (client->num_persistent_updates == 0) {
 		DEBUG(DEBUG_ERR, (__location__ " ERROR: num_persistent_updates == 0\n"));
+		DEBUG(DEBUG_ERR,(__location__ " Forcing recovery\n"));
+		client->ctdb->recovery_mode = CTDB_RECOVERY_ACTIVE;
 		return -1;
 	}
 	client->num_persistent_updates--;
@@ -481,9 +483,9 @@ int32_t ctdb_control_trans2_error(struct ctdb_context *ctdb,
 	
 	if (client->num_persistent_updates == 0) {
 		DEBUG(DEBUG_ERR, (__location__ " ERROR: num_persistent_updates == 0\n"));
-		return -1;
+	} else {
+		client->num_persistent_updates--;
 	}
-	client->num_persistent_updates--;
 
 	DEBUG(DEBUG_ERR,(__location__ " Forcing recovery\n"));
 	client->ctdb->recovery_mode = CTDB_RECOVERY_ACTIVE;


-- 
CTDB repository


More information about the samba-cvs mailing list