------------------------------------------------------------
revno: 174
revision-id: [EMAIL PROTECTED]
parent: [EMAIL PROTECTED]
committer: Andrew Tridgell <[EMAIL PROTECTED]>
branch nick: tridge
timestamp: Sat 2007-04-21 09:22:46 +0200
message:
  - prevent sending dmaster requests to ourselves
  
  - add some debug code
modified:
  common/ctdb_call.c             ctdb_call.c-20061128065342-to93h6eejj5kon81-1
  common/ctdb_client.c           ctdb_client.c-20070411010216-3kd8v37k61steeya-1
=== modified file 'common/ctdb_call.c'
--- a/common/ctdb_call.c        2007-04-20 07:58:37 +0000
+++ b/common/ctdb_call.c        2007-04-21 07:22:46 +0000
@@ -370,9 +370,10 @@
           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 @@
 
        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 @@
                       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);

=== modified file 'common/ctdb_client.c'
--- a/common/ctdb_client.c      2007-04-20 10:07:47 +0000
+++ b/common/ctdb_client.c      2007-04-21 07:22:46 +0000
@@ -71,7 +71,7 @@
 
        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 @@
 
        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;
        }
 

Reply via email to