------------------------------------------------------------
revno: 322
revision-id: [EMAIL PROTECTED]
parent: [EMAIL PROTECTED]
parent: [EMAIL PROTECTED]
committer: Andrew Tridgell <[EMAIL PROTECTED]>
branch nick: tridge
timestamp: Sat 2007-05-19 13:18:56 +1000
message:
  merge tx_cnt code from ronnie
modified:
  common/ctdb.c                  ctdb.c-20061127094323-t50f58d65iaao5of-2
  common/ctdb_monitor.c          
ctdb_monitor.c-20070518100625-8jf4ft1mjzmb22ck-1
  include/ctdb_private.h         
ctdb_private.h-20061117234101-o3qt14umlg9en8z0-13
    ------------------------------------------------------------
    revno: 197.1.122
    merged: [EMAIL PROTECTED]
    parent: [EMAIL PROTECTED]
    committer: Ronnie Sahlberg <[EMAIL PROTECTED]>
    branch nick: ctdb
    timestamp: Sat 2007-05-19 10:27:17 +1000
    message:
      increase the tx_cnt everytime we send a packet to a node
    ------------------------------------------------------------
    revno: 197.1.121
    merged: [EMAIL PROTECTED]
    parent: [EMAIL PROTECTED]
    committer: Ronnie Sahlberg <[EMAIL PROTECTED]>
    branch nick: ctdb
    timestamp: Sat 2007-05-19 10:20:19 +1000
    message:
      add a node->tx_cnt counter
      
      only send keepalive packets if the count is zero
    ------------------------------------------------------------
    revno: 197.1.120
    merged: [EMAIL PROTECTED]
    parent: [EMAIL PROTECTED]
    parent: [EMAIL PROTECTED]
    committer: Ronnie Sahlberg <[EMAIL PROTECTED]>
    branch nick: ctdb
    timestamp: Sat 2007-05-19 10:12:37 +1000
    message:
      merge from tridge
=== modified file 'common/ctdb.c'
--- a/common/ctdb.c     2007-05-18 13:48:29 +0000
+++ b/common/ctdb.c     2007-05-19 00:27:17 +0000
@@ -507,8 +507,11 @@
 
        if (hdr->destnode == ctdb->vnn && !(ctdb->flags & 
CTDB_FLAG_SELF_CONNECT)) {
                ctdb_defer_packet(ctdb, hdr);
-       } else if (ctdb->methods->queue_pkt(node, (uint8_t *)hdr, hdr->length) 
!= 0) {
-               ctdb_fatal(ctdb, "Unable to queue packet\n");
+       } else {
+               node->tx_cnt++;
+               if (ctdb->methods->queue_pkt(node, (uint8_t *)hdr, hdr->length) 
!= 0) {
+                       ctdb_fatal(ctdb, "Unable to queue packet\n");
+               }
        }
 }
 

=== modified file 'common/ctdb_monitor.c'
--- a/common/ctdb_monitor.c     2007-05-18 13:48:29 +0000
+++ b/common/ctdb_monitor.c     2007-05-19 00:20:19 +0000
@@ -64,8 +64,12 @@
                        */
                        continue;
                }
+               
+               if (node->tx_cnt == 0) {
+                       ctdb_send_keepalive(ctdb, node->vnn);
+               }
 
-               ctdb_send_keepalive(ctdb, node->vnn);
+               node->tx_cnt = 0;
        }
        
        event_add_timed(ctdb->ev, ctdb, 

=== modified file 'include/ctdb_private.h'
--- a/include/ctdb_private.h    2007-05-18 14:56:49 +0000
+++ b/include/ctdb_private.h    2007-05-19 00:20:19 +0000
@@ -93,6 +93,7 @@
        /* used by the dead node monitoring */
        uint32_t dead_count;
        uint32_t rx_cnt;
+       uint32_t tx_cnt;
 
        /* a list of controls pending to this node, so we can time them out 
quickly
           if the node becomes disconnected */

Reply via email to