[SCM] CTDB repository - branch 1.0.112 updated - ctdb-1.0.111-99-g615801f

Ronnie Sahlberg sahlberg at samba.org
Tue Jun 8 22:39:46 MDT 2010


The branch, 1.0.112 has been updated
       via  615801f246ed6c9e6cf402b8647ac65b667ba802 (commit)
       via  fe5b91161c236385ddafe67291fd6f27cd5887c2 (commit)
       via  89205049bfc3368fae1c7100db19dbd77327a1d5 (commit)
       via  2d3cc33576d5e0b62fddbc644bbe125564473edc (commit)
      from  9a38f9598e6f81fe25347487b51b62703a41922f (commit)

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


- Log -----------------------------------------------------------------
commit 615801f246ed6c9e6cf402b8647ac65b667ba802
Author: Ronnie Sahlberg <ronniesahlberg at gmail.com>
Date:   Wed Jun 9 14:31:05 2010 +1000

    add extra logging for failed ctdb_ltdb_unlock() for a few more places
    it is called from

commit fe5b91161c236385ddafe67291fd6f27cd5887c2
Author: Ronnie Sahlberg <ronniesahlberg at gmail.com>
Date:   Wed Jun 9 14:17:35 2010 +1000

    add additional logging when tdb_chainunlock() fails
    so we can see where it was called from when it fails

commit 89205049bfc3368fae1c7100db19dbd77327a1d5
Author: Ronnie Sahlberg <ronniesahlberg at gmail.com>
Date:   Wed Jun 9 13:54:10 2010 +1000

    print the db name qwhen a chainunlock fails too

commit 2d3cc33576d5e0b62fddbc644bbe125564473edc
Author: Ronnie Sahlberg <ronniesahlberg at gmail.com>
Date:   Wed Jun 9 13:52:22 2010 +1000

    when tdb_chainunlock() fails, print the tdb error that occured

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

Summary of changes:
 common/ctdb_ltdb.c        |    2 +-
 server/ctdb_call.c        |   47 +++++++++++++++++++++++++++++++++++++-------
 server/ctdb_daemon.c      |   17 +++++++++++++--
 server/ctdb_ltdb_server.c |    6 ++++-
 4 files changed, 59 insertions(+), 13 deletions(-)


Changeset truncated at 500 lines:

diff --git a/common/ctdb_ltdb.c b/common/ctdb_ltdb.c
index d35b690..6ce5c90 100644
--- a/common/ctdb_ltdb.c
+++ b/common/ctdb_ltdb.c
@@ -191,7 +191,7 @@ int ctdb_ltdb_unlock(struct ctdb_db_context *ctdb_db, TDB_DATA key)
 {
 	int ret = tdb_chainunlock(ctdb_db->ltdb->tdb, key);
 	if (ret != 0) {
-		DEBUG(DEBUG_ERR,(__location__ " tdb_chainunlock failed on database %s\n", ctdb_db->db_name));
+ 		DEBUG(DEBUG_ERR,("tdb_chainunlock failed on db %s [%s]\n", ctdb_db->db_name, tdb_errorstr(ctdb_db->ltdb->tdb)));
 	}
 	return ret;
 }
diff --git a/server/ctdb_call.c b/server/ctdb_call.c
index 6ad9305..dc6dc95 100644
--- a/server/ctdb_call.c
+++ b/server/ctdb_call.c
@@ -245,6 +245,7 @@ static void ctdb_become_dmaster(struct ctdb_db_context *ctdb_db,
 	struct ctdb_call_state *state;
 	struct ctdb_context *ctdb = ctdb_db->ctdb;
 	struct ctdb_ltdb_header header;
+	int ret;
 
 	DEBUG(DEBUG_DEBUG,("pnn %u dmaster response %08x\n", ctdb->pnn, ctdb_hash(&key)));
 
@@ -254,7 +255,11 @@ static void ctdb_become_dmaster(struct ctdb_db_context *ctdb_db,
 
 	if (ctdb_ltdb_store(ctdb_db, key, &header, data) != 0) {
 		ctdb_fatal(ctdb, "ctdb_reply_dmaster store failed\n");
-		ctdb_ltdb_unlock(ctdb_db, key);
+
+		ret = ctdb_ltdb_unlock(ctdb_db, key);
+		if (ret != 0) {
+			DEBUG(DEBUG_ERR,(__location__ " ctdb_ltdb_unlock() failed with error %d\n", ret));
+		}
 		return;
 	}
 
@@ -263,20 +268,31 @@ static void ctdb_become_dmaster(struct ctdb_db_context *ctdb_db,
 	if (state == NULL) {
 		DEBUG(DEBUG_ERR,("pnn %u Invalid reqid %u in ctdb_become_dmaster from node %u\n",
 			 ctdb->pnn, hdr->reqid, hdr->srcnode));
-		ctdb_ltdb_unlock(ctdb_db, key);
+
+		ret = ctdb_ltdb_unlock(ctdb_db, key);
+		if (ret != 0) {
+			DEBUG(DEBUG_ERR,(__location__ " ctdb_ltdb_unlock() failed with error %d\n", ret));
+		}
 		return;
 	}
 
 	if (hdr->reqid != state->reqid) {
 		/* we found a record  but it was the wrong one */
 		DEBUG(DEBUG_ERR, ("Dropped orphan in ctdb_become_dmaster with reqid:%u\n from node %u", hdr->reqid, hdr->srcnode));
-		ctdb_ltdb_unlock(ctdb_db, key);
+
+		ret = ctdb_ltdb_unlock(ctdb_db, key);
+		if (ret != 0) {
+			DEBUG(DEBUG_ERR,(__location__ " ctdb_ltdb_unlock() failed with error %d\n", ret));
+		}
 		return;
 	}
 
 	ctdb_call_local(ctdb_db, state->call, &header, state, &data, ctdb->pnn);
 
-	ctdb_ltdb_unlock(ctdb_db, state->call->key);
+	ret = ctdb_ltdb_unlock(ctdb_db, key);
+	if (ret != 0) {
+		DEBUG(DEBUG_ERR,(__location__ " ctdb_ltdb_unlock() failed with error %d\n", ret));
+	}
 
 	state->state = CTDB_CALL_DONE;
 	if (state->async.fn) {
@@ -364,7 +380,11 @@ void ctdb_request_dmaster(struct ctdb_context *ctdb, struct ctdb_req_header *hdr
 		ctdb_become_dmaster(ctdb_db, hdr, key, data, c->rsn);
 	} else {
 		ctdb_send_dmaster_reply(ctdb_db, &header, key, data, c->dmaster, hdr->reqid);
-		ctdb_ltdb_unlock(ctdb_db, key);
+
+		ret = ctdb_ltdb_unlock(ctdb_db, key);
+		if (ret != 0) {
+			DEBUG(DEBUG_ERR,(__location__ " ctdb_ltdb_unlock() failed with error %d\n", ret));
+		}
 	}
 }
 
@@ -425,7 +445,11 @@ void ctdb_request_call(struct ctdb_context *ctdb, struct ctdb_req_header *hdr)
 	if (header.dmaster != ctdb->pnn) {
 		talloc_free(data.dptr);
 		ctdb_call_send_redirect(ctdb, call->key, c, &header);
-		ctdb_ltdb_unlock(ctdb_db, call->key);
+
+		ret = ctdb_ltdb_unlock(ctdb_db, call->key);
+		if (ret != 0) {
+			DEBUG(DEBUG_ERR,(__location__ " ctdb_ltdb_unlock() failed with error %d\n", ret));
+		}
 		return;
 	}
 
@@ -450,14 +474,21 @@ void ctdb_request_call(struct ctdb_context *ctdb, struct ctdb_req_header *hdr)
 				 ctdb->pnn, ctdb_hash(&(call->key)), c->hdr.srcnode));
 			ctdb_call_send_dmaster(ctdb_db, c, &header, &(call->key), &data);
 			talloc_free(data.dptr);
-			ctdb_ltdb_unlock(ctdb_db, call->key);
+
+			ret = ctdb_ltdb_unlock(ctdb_db, call->key);
+			if (ret != 0) {
+				DEBUG(DEBUG_ERR,(__location__ " ctdb_ltdb_unlock() failed with error %d\n", ret));
+			}
 			return;
 		}
 	}
 
 	ctdb_call_local(ctdb_db, call, &header, hdr, &data, c->hdr.srcnode);
 
-	ctdb_ltdb_unlock(ctdb_db, call->key);
+	ret = ctdb_ltdb_unlock(ctdb_db, call->key);
+	if (ret != 0) {
+		DEBUG(DEBUG_ERR,(__location__ " ctdb_ltdb_unlock() failed with error %d\n", ret));
+	}
 
 	len = offsetof(struct ctdb_reply_call, data) + call->reply_data.dsize;
 	r = ctdb_transport_allocate(ctdb, ctdb, CTDB_REPLY_CALL, len, 
diff --git a/server/ctdb_daemon.c b/server/ctdb_daemon.c
index 4bedcc5..1dbf3e6 100644
--- a/server/ctdb_daemon.c
+++ b/server/ctdb_daemon.c
@@ -401,7 +401,11 @@ static void daemon_request_call_from_client(struct ctdb_client *client,
 
 	dstate = talloc(client, struct daemon_call_state);
 	if (dstate == NULL) {
-		ctdb_ltdb_unlock(ctdb_db, key);
+		ret = ctdb_ltdb_unlock(ctdb_db, key);
+		if (ret != 0) {
+			DEBUG(DEBUG_ERR,(__location__ " ctdb_ltdb_unlock() failed with error %d\n", ret));
+		}
+
 		DEBUG(DEBUG_ERR,(__location__ " Unable to allocate dstate\n"));
 		if (client->ctdb->statistics.pending_calls > 0) {
 			ctdb->statistics.pending_calls--;
@@ -415,7 +419,11 @@ static void daemon_request_call_from_client(struct ctdb_client *client,
 
 	call = dstate->call = talloc_zero(dstate, struct ctdb_call);
 	if (call == NULL) {
-		ctdb_ltdb_unlock(ctdb_db, key);
+		ret = ctdb_ltdb_unlock(ctdb_db, key);
+		if (ret != 0) {
+			DEBUG(DEBUG_ERR,(__location__ " ctdb_ltdb_unlock() failed with error %d\n", ret));
+		}
+
 		DEBUG(DEBUG_ERR,(__location__ " Unable to allocate call\n"));
 		if (client->ctdb->statistics.pending_calls > 0) {
 			ctdb->statistics.pending_calls--;
@@ -436,7 +444,10 @@ static void daemon_request_call_from_client(struct ctdb_client *client,
 		state = ctdb_daemon_call_send_remote(ctdb_db, call, &header);
 	}
 
-	ctdb_ltdb_unlock(ctdb_db, key);
+	ret = ctdb_ltdb_unlock(ctdb_db, key);
+	if (ret != 0) {
+		DEBUG(DEBUG_ERR,(__location__ " ctdb_ltdb_unlock() failed with error %d\n", ret));
+	}
 
 	if (state == NULL) {
 		DEBUG(DEBUG_ERR,(__location__ " Unable to setup call send\n"));
diff --git a/server/ctdb_ltdb_server.c b/server/ctdb_ltdb_server.c
index 9b3e7e0..1ce7283 100644
--- a/server/ctdb_ltdb_server.c
+++ b/server/ctdb_ltdb_server.c
@@ -170,7 +170,11 @@ int ctdb_ltdb_lock_fetch_requeue(struct ctdb_db_context *ctdb_db,
 	if (ret == 0) {
 		ret = ctdb_ltdb_fetch(ctdb_db, key, header, hdr, data);
 		if (ret != 0) {
-			ctdb_ltdb_unlock(ctdb_db, key);
+			int uret;
+			uret = ctdb_ltdb_unlock(ctdb_db, key);
+			if (uret != 0) {
+				DEBUG(DEBUG_ERR,(__location__ " ctdb_ltdb_unlock() failed with error %d\n", uret));
+			}
 		}
 	}
 	return ret;


-- 
CTDB repository


More information about the samba-cvs mailing list