You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafficserver.apache.org by ch...@apache.org on 2013/09/10 09:28:10 UTC

git commit: TS-2185: support to control ClusterCom::sendSharedData frequency

Updated Branches:
  refs/heads/master 55f792ee0 -> 0a92bcdcc


TS-2185: support to control ClusterCom::sendSharedData frequency


Project: http://git-wip-us.apache.org/repos/asf/trafficserver/repo
Commit: http://git-wip-us.apache.org/repos/asf/trafficserver/commit/0a92bcdc
Tree: http://git-wip-us.apache.org/repos/asf/trafficserver/tree/0a92bcdc
Diff: http://git-wip-us.apache.org/repos/asf/trafficserver/diff/0a92bcdc

Branch: refs/heads/master
Commit: 0a92bcdccec4e79e1527521a01f2a464a7d6ce28
Parents: 55f792e
Author: Chen Bin <ku...@taobao.com>
Authored: Tue Sep 10 15:27:21 2013 +0800
Committer: Chen Bin <ku...@taobao.com>
Committed: Tue Sep 10 15:27:21 2013 +0800

----------------------------------------------------------------------
 CHANGES                    | 2 ++
 mgmt/RecordsConfig.cc      | 2 ++
 mgmt/cluster/ClusterCom.cc | 5 +++++
 mgmt/cluster/ClusterCom.h  | 1 +
 4 files changed, 10 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/trafficserver/blob/0a92bcdc/CHANGES
----------------------------------------------------------------------
diff --git a/CHANGES b/CHANGES
index faa6402..e973653 100644
--- a/CHANGES
+++ b/CHANGES
@@ -2,6 +2,8 @@
 Changes with Apache Traffic Server 4.1.0
 
 
+  *) [TS-2185] Support to control ClusterCom::sendSharedData frequency.
+
   *) [TS-2195] Deprecate experimental TSHttpTxnCacheLookupSkip API.
 
   *) [TS-2176] Do not reset value of api_skip_cache_lookup when reading it.

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/0a92bcdc/mgmt/RecordsConfig.cc
----------------------------------------------------------------------
diff --git a/mgmt/RecordsConfig.cc b/mgmt/RecordsConfig.cc
index 86ce925..d9e4ab3 100644
--- a/mgmt/RecordsConfig.cc
+++ b/mgmt/RecordsConfig.cc
@@ -215,6 +215,8 @@ RecordElement RecordsConfig[] = {
   ,
   {RECT_CONFIG, "proxy.config.cluster.peer_timeout", RECD_INT, "30", RECU_NULL, RR_NULL, RECC_NULL, NULL, RECA_NULL}
   ,
+  {RECT_CONFIG, "proxy.config.cluster.mc_send_interval", RECD_INT, "2", RECU_NULL, RR_NULL, RECC_NULL, NULL, RECA_NULL}
+  ,
   {RECT_CONFIG, "proxy.config.cluster.startup_timeout", RECD_INT, "10", RECU_NULL, RR_NULL, RECC_NULL, NULL, RECA_NULL}
   ,
   //# cluster type requires restart to change

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/0a92bcdc/mgmt/cluster/ClusterCom.cc
----------------------------------------------------------------------
diff --git a/mgmt/cluster/ClusterCom.cc b/mgmt/cluster/ClusterCom.cc
index a365412..2e3a7e4 100644
--- a/mgmt/cluster/ClusterCom.cc
+++ b/mgmt/cluster/ClusterCom.cc
@@ -423,6 +423,9 @@ ClusterCom::ClusterCom(unsigned long oip, char *host, int mcport, char *group, i
   peer_timeout = REC_readInteger("proxy.config.cluster.peer_timeout", &found);
   ink_assert(found);
 
+  mc_send_interval = REC_readInteger("proxy.config.cluster.mc_send_interval", &found);
+  ink_assert(found);
+
   /* Launch time */
   startup_time = time(NULL);
 
@@ -1308,6 +1311,8 @@ ClusterCom::sendSharedData(bool send_proxy_heart_beat)
     int time_since_last_send = now - last_shared_send;
     if (last_shared_send != 0 && time_since_last_send > peer_timeout) {
       Warning("multicast send timeout exceeded.  %d seconds since" " last send.", time_since_last_send);
+    } else if (last_shared_send != 0 && time_since_last_send < mc_send_interval) {
+      return true;
     }
     last_shared_send = now;
   }

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/0a92bcdc/mgmt/cluster/ClusterCom.h
----------------------------------------------------------------------
diff --git a/mgmt/cluster/ClusterCom.h b/mgmt/cluster/ClusterCom.h
index 39b10f3..3300336 100644
--- a/mgmt/cluster/ClusterCom.h
+++ b/mgmt/cluster/ClusterCom.h
@@ -152,6 +152,7 @@ public:
 
   time_t delta_thresh;
   time_t peer_timeout;
+  time_t mc_send_interval;
   time_t our_wall_clock;
   time_t startup_timeout;
   time_t startup_time;


Re: git commit: TS-2185: support to control ClusterCom::sendSharedData frequency

Posted by Igor Galić <i....@brainsware.org>.

----- Original Message -----
> Updated Branches:
>   refs/heads/master 55f792ee0 -> 0a92bcdcc
> 
> 
> TS-2185: support to control ClusterCom::sendSharedData frequency
> 
> 
> Project: http://git-wip-us.apache.org/repos/asf/trafficserver/repo
> Commit: http://git-wip-us.apache.org/repos/asf/trafficserver/commit/0a92bcdc
> Tree: http://git-wip-us.apache.org/repos/asf/trafficserver/tree/0a92bcdc
> Diff: http://git-wip-us.apache.org/repos/asf/trafficserver/diff/0a92bcdc
> 
> Branch: refs/heads/master
> Commit: 0a92bcdccec4e79e1527521a01f2a464a7d6ce28
> Parents: 55f792e
> Author: Chen Bin <ku...@taobao.com>
> Authored: Tue Sep 10 15:27:21 2013 +0800
> Committer: Chen Bin <ku...@taobao.com>
> Committed: Tue Sep 10 15:27:21 2013 +0800
> 
> ----------------------------------------------------------------------
>  CHANGES                    | 2 ++
>  mgmt/RecordsConfig.cc      | 2 ++
>  mgmt/cluster/ClusterCom.cc | 5 +++++
>  mgmt/cluster/ClusterCom.h  | 1 +
>  4 files changed, 10 insertions(+)
> ----------------------------------------------------------------------
> 
> 
> http://git-wip-us.apache.org/repos/asf/trafficserver/blob/0a92bcdc/CHANGES
> ----------------------------------------------------------------------
> diff --git a/CHANGES b/CHANGES
> index faa6402..e973653 100644
> --- a/CHANGES
> +++ b/CHANGES
> @@ -2,6 +2,8 @@
>  Changes with Apache Traffic Server 4.1.0
>  
>  
> +  *) [TS-2185] Support to control ClusterCom::sendSharedData frequency.
> +
>    *) [TS-2195] Deprecate experimental TSHttpTxnCacheLookupSkip API.
>  
>    *) [TS-2176] Do not reset value of api_skip_cache_lookup when reading it.
> 
> http://git-wip-us.apache.org/repos/asf/trafficserver/blob/0a92bcdc/mgmt/RecordsConfig.cc
> ----------------------------------------------------------------------
> diff --git a/mgmt/RecordsConfig.cc b/mgmt/RecordsConfig.cc
> index 86ce925..d9e4ab3 100644
> --- a/mgmt/RecordsConfig.cc
> +++ b/mgmt/RecordsConfig.cc
> @@ -215,6 +215,8 @@ RecordElement RecordsConfig[] = {
>    ,
>    {RECT_CONFIG, "proxy.config.cluster.peer_timeout", RECD_INT, "30",
>    RECU_NULL, RR_NULL, RECC_NULL, NULL, RECA_NULL}
>    ,
> +  {RECT_CONFIG, "proxy.config.cluster.mc_send_interval", RECD_INT, "2",
> RECU_NULL, RR_NULL, RECC_NULL, NULL, RECA_NULL}
> +  ,
>    {RECT_CONFIG, "proxy.config.cluster.startup_timeout", RECD_INT, "10",
>    RECU_NULL, RR_NULL, RECC_NULL, NULL, RECA_NULL}
>    ,
>    //# cluster type requires restart to change
> 
> http://git-wip-us.apache.org/repos/asf/trafficserver/blob/0a92bcdc/mgmt/cluster/ClusterCom.cc
> ----------------------------------------------------------------------
> diff --git a/mgmt/cluster/ClusterCom.cc b/mgmt/cluster/ClusterCom.cc
> index a365412..2e3a7e4 100644
> --- a/mgmt/cluster/ClusterCom.cc
> +++ b/mgmt/cluster/ClusterCom.cc
> @@ -423,6 +423,9 @@ ClusterCom::ClusterCom(unsigned long oip, char *host, int
> mcport, char *group, i
>    peer_timeout = REC_readInteger("proxy.config.cluster.peer_timeout",
>    &found);
>    ink_assert(found);
>  
> +  mc_send_interval =
> REC_readInteger("proxy.config.cluster.mc_send_interval", &found);
> +  ink_assert(found);
> +
>    /* Launch time */
>    startup_time = time(NULL);
>  
> @@ -1308,6 +1311,8 @@ ClusterCom::sendSharedData(bool send_proxy_heart_beat)
>      int time_since_last_send = now - last_shared_send;
>      if (last_shared_send != 0 && time_since_last_send > peer_timeout) {
>        Warning("multicast send timeout exceeded.  %d seconds since" " last
>        send.", time_since_last_send);
> +    } else if (last_shared_send != 0 && time_since_last_send <
> mc_send_interval) {
> +      return true;
>      }
>      last_shared_send = now;
>    }
> 
> http://git-wip-us.apache.org/repos/asf/trafficserver/blob/0a92bcdc/mgmt/cluster/ClusterCom.h
> ----------------------------------------------------------------------
> diff --git a/mgmt/cluster/ClusterCom.h b/mgmt/cluster/ClusterCom.h
> index 39b10f3..3300336 100644
> --- a/mgmt/cluster/ClusterCom.h
> +++ b/mgmt/cluster/ClusterCom.h
> @@ -152,6 +152,7 @@ public:
>  
>    time_t delta_thresh;
>    time_t peer_timeout;
> +  time_t mc_send_interval;
>    time_t our_wall_clock;
>    time_t startup_timeout;
>    time_t startup_time;
> 
> 

proxy.config.cluster.mc_send_interval is missing an entry in lib/perl/lib/Apache/TS/AdminClient.pm as well as under doc/reference/configuration/records.config.en.rst (perhaps, if relevant, also mention in doc/admin/cluster-howto.en.rst )

-- 
Igor Galić

Tel: +43 (0) 664 886 22 883
Mail: i.galic@brainsware.org
URL: http://brainsware.org/
GPG: 6880 4155 74BD FD7C B515  2EA5 4B1D 9E08 A097 C9AE