From: Andrew Tridgell Date: Sat, 21 Apr 2007 07:22:46 +0000 (+0200) Subject: - prevent sending dmaster requests to ourselves X-Git-Tag: tevent-0.9.20~348^2~2857 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=520f7971cd5b7ad2a4cf53012e139c26b682600d;p=thirdparty%2Fsamba.git - prevent sending dmaster requests to ourselves - add some debug code (This used to be ctdb commit 26ad1ec3a3b872520a735e4fe4f224f716643731) --- diff --git a/ctdb/common/ctdb_call.c b/ctdb/common/ctdb_call.c index 76a7e97a87e..f4505052f8f 100644 --- a/ctdb/common/ctdb_call.c +++ b/ctdb/common/ctdb_call.c @@ -370,9 +370,10 @@ void ctdb_request_call(struct ctdb_context *ctdb, struct ctdb_req_header *hdr) then give them the record or if the node requested an immediate migration */ - if ( (header.laccessor == c->hdr.srcnode - && header.lacount >= ctdb->max_lacount) - || c->flags&CTDB_IMMEDIATE_MIGRATION ) { + if ( c->hdr.srcnode != ctdb->vnn && + ((header.laccessor == c->hdr.srcnode + && header.lacount >= ctdb->max_lacount) + || (c->flags&CTDB_IMMEDIATE_MIGRATION)) ) { ctdb_call_send_dmaster(ctdb_db, c, &header, &call.key, &data); talloc_free(data.dptr); ctdb_ltdb_unlock(ctdb_db, call.key); @@ -419,7 +420,7 @@ void ctdb_reply_call(struct ctdb_context *ctdb, struct ctdb_req_header *hdr) state = idr_find_type(ctdb->idr, hdr->reqid, struct ctdb_call_state); if (state == NULL) { - DEBUG(0, ("reqid %d not found\n", hdr->reqid)); + DEBUG(0, (__location__ " reqid %d not found\n", hdr->reqid)); return; } @@ -562,6 +563,7 @@ void ctdb_call_timeout(struct event_context *ev, struct timed_event *te, struct timeval t, void *private_data) { struct ctdb_call_state *state = talloc_get_type(private_data, struct ctdb_call_state); + DEBUG(0,(__location__ " call timeout for reqid %d\n", state->c->hdr.reqid)); state->state = CTDB_CALL_ERROR; ctdb_set_error(state->node->ctdb, "ctdb_call %u timed out", state->c->hdr.reqid); diff --git a/ctdb/common/ctdb_client.c b/ctdb/common/ctdb_client.c index dbed8d35851..bc61c37c8a8 100644 --- a/ctdb/common/ctdb_client.c +++ b/ctdb/common/ctdb_client.c @@ -71,7 +71,7 @@ static void ctdb_client_reply_call(struct ctdb_context *ctdb, struct ctdb_req_he state = idr_find_type(ctdb->idr, hdr->reqid, struct ctdb_client_call_state); if (state == NULL) { - DEBUG(0, ("reqid %d not found\n", hdr->reqid)); + DEBUG(0,(__location__ " reqid %d not found\n", hdr->reqid)); return; } @@ -628,7 +628,7 @@ static void ctdb_reply_status(struct ctdb_context *ctdb, struct ctdb_req_header state = idr_find_type(ctdb->idr, hdr->reqid, struct ctdb_status_state); if (state == NULL) { - DEBUG(0, ("reqid %d not found\n", hdr->reqid)); + DEBUG(0,(__location__ " reqid %d not found\n", hdr->reqid)); return; }