You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafficserver.apache.org by zw...@apache.org on 2011/05/14 22:20:43 UTC
svn commit: r1103209 - in /trafficserver/traffic/trunk/mgmt: Main.cc
cluster/ClusterCom.cc
Author: zwoop
Date: Sat May 14 20:20:43 2011
New Revision: 1103209
URL: http://svn.apache.org/viewvc?rev=1103209&view=rev
Log:
TS-775 Disable cluster autodiscovery via multicast when clustering is disabled.
Review: Igor Galic
Modified:
trafficserver/traffic/trunk/mgmt/Main.cc
trafficserver/traffic/trunk/mgmt/cluster/ClusterCom.cc
Modified: trafficserver/traffic/trunk/mgmt/Main.cc
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/mgmt/Main.cc?rev=1103209&r1=1103208&r2=1103209&view=diff
==============================================================================
--- trafficserver/traffic/trunk/mgmt/Main.cc (original)
+++ trafficserver/traffic/trunk/mgmt/Main.cc Sat May 14 20:20:43 2011
@@ -876,9 +876,6 @@ main(int argc, char **argv)
lmgmt->ccom->sendSharedData(false);
}
- // Aggregate node statistics
- // overviewGenerator->doClusterAg();
-
lmgmt->ccom->checkPeers(&ticker);
overviewGenerator->checkForUpdates();
Modified: trafficserver/traffic/trunk/mgmt/cluster/ClusterCom.cc
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/mgmt/cluster/ClusterCom.cc?rev=1103209&r1=1103208&r2=1103209&view=diff
==============================================================================
--- trafficserver/traffic/trunk/mgmt/cluster/ClusterCom.cc (original)
+++ trafficserver/traffic/trunk/mgmt/cluster/ClusterCom.cc Sat May 14 20:20:43 2011
@@ -383,8 +383,8 @@ ClusterCom::ClusterCom(unsigned long oip
ink_filepath_merge(cluster_conf, sizeof(cluster_conf), p, cluster_file, INK_FILEPATH_TRUENAME);
// XXX: Shouldn't we pass the cluster_conf to the Rollback ???
//
- Debug("ccom", "[ClusterCom::ClusterCom] Using cluster file: %s", cluster_file);
- Debug("ccom", "[ClusterCom::ClusterCom] Using cluster conf: %s", cluster_conf);
+ Debug("ccom", "[ClusterCom::ClusterCom] Using cluster file: %s", cluster_file);
+ Debug("ccom", "[ClusterCom::ClusterCom] Using cluster conf: %s", cluster_conf);
cluster_file_rb = new Rollback(cluster_file, false);
xfree(cluster_file);
@@ -435,13 +435,8 @@ ClusterCom::ClusterCom(unsigned long oip
peers = ink_hash_table_create(InkHashTableKeyType_String);
mismatchLog = ink_hash_table_create(InkHashTableKeyType_String);
- /*
- * Setup a temporary area for collating the node stats safe since
- * these are static
- */
- // fix me -- what does aggregated_node_data do?
-
- ink_thread_create(drainIncomingChannel, 0); /* Spin drainer thread */
+ if (cluster_type != NO_CLUSTER)
+ ink_thread_create(drainIncomingChannel, 0); /* Spin drainer thread */
return;
} /* End ClusterCom::ClusterCom */
@@ -460,6 +455,9 @@ ClusterCom::checkPeers(time_t * ticker)
InkHashTableEntry *entry;
InkHashTableIteratorState iterator_state;
+ if (cluster_type == NO_CLUSTER)
+ return;
+
if ((t - *ticker) > 5) {
int num_peers = 0;
long idle_since;
@@ -640,6 +638,9 @@ ClusterCom::generateClusterDelta(void)
InkHashTableEntry *entry;
InkHashTableIteratorState iterator_state;
+ if (cluster_type == NO_CLUSTER)
+ return;
+
ink_mutex_acquire(&(mutex));
for (entry = ink_hash_table_iterator_first(peers, &iterator_state);
entry != NULL; entry = ink_hash_table_iterator_next(peers, &iterator_state)) {