]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
- prevent sending dmaster requests to ourselves
authorAndrew Tridgell <tridge@samba.org>
Sat, 21 Apr 2007 07:22:46 +0000 (09:22 +0200)
committerAndrew Tridgell <tridge@samba.org>
Sat, 21 Apr 2007 07:22:46 +0000 (09:22 +0200)
- add some debug code

(This used to be ctdb commit 26ad1ec3a3b872520a735e4fe4f224f716643731)

ctdb/common/ctdb_call.c
ctdb/common/ctdb_client.c

index 76a7e97a87ea63289d56a5d14da26ad142981941..f4505052f8fd669c04984505cee93d03efae4451 100644 (file)
@@ -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);
index dbed8d35851d72a224b9ad7cee372c2504617b4e..bc61c37c8a84df7e21b05b3aedad7c2b1ad5c171 100644 (file)
@@ -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;
        }