[SCM] CTDB repository - branch master updated - ctdb-1.0.114-152-g5c0fea9
Ronnie Sahlberg
sahlberg at samba.org
Tue Jun 8 22:39:46 MDT 2010
The branch, master has been updated
via 5c0fea90c6474a51992a9c4aeb6af7dfeb213ee0 (commit)
via 0c091b3db6bdefd371787d87bc749593ea8e3c76 (commit)
via 7932156d7f25870e6937faca08bf75d3cdbad2e5 (commit)
via dcdd2010905b9007fbf7ab71f576cfbd48acce8a (commit)
from 18168da84a6aa8d69465e43402444c7ec979604a (commit)
http://gitweb.samba.org/?p=sahlberg/ctdb.git;a=shortlog;h=master
- Log -----------------------------------------------------------------
commit 5c0fea90c6474a51992a9c4aeb6af7dfeb213ee0
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 0c091b3db6bdefd371787d87bc749593ea8e3c76
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 7932156d7f25870e6937faca08bf75d3cdbad2e5
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 dcdd2010905b9007fbf7ab71f576cfbd48acce8a
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 e07b98c..6ef73fe 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 39fb4ed..0a57a8a 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