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 2013/11/03 04:40:05 UTC

[26/41] git commit: TS-2302: permanently enable IOCORE_LOG_COLLATION

TS-2302: permanently enable IOCORE_LOG_COLLATION


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

Branch: refs/heads/5.0.x
Commit: c078edfc8d8b620a3bc7c283aa91dfa2f82043ca
Parents: 70305eb
Author: James Peach <jp...@apache.org>
Authored: Thu Sep 26 10:14:48 2013 -0700
Committer: James Peach <jp...@apache.org>
Committed: Thu Oct 31 08:16:27 2013 -0700

----------------------------------------------------------------------
 proxy/logcat.cc            |  1 -
 proxy/logging/Log.cc       | 17 ----------------
 proxy/logging/LogConfig.cc | 17 ----------------
 proxy/logging/LogConfig.h  |  4 ----
 proxy/logging/LogHost.cc   | 44 -----------------------------------------
 proxy/logging/LogHost.h    |  4 ----
 proxy/logging/Makefile.am  |  2 --
 7 files changed, 89 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/trafficserver/blob/c078edfc/proxy/logcat.cc
----------------------------------------------------------------------
diff --git a/proxy/logcat.cc b/proxy/logcat.cc
index 1d30504..ae851bd 100644
--- a/proxy/logcat.cc
+++ b/proxy/logcat.cc
@@ -27,7 +27,6 @@
 
 #define PROGRAM_NAME        "traffic_logcat"
 #define MAX_LOGBUFFER_SIZE  65536
-#undef IOCORE_LOG_COLLATION
 
 #include <poll.h>
 

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/c078edfc/proxy/logging/Log.cc
----------------------------------------------------------------------
diff --git a/proxy/logging/Log.cc b/proxy/logging/Log.cc
index ab81d86..4dd8dc1 100644
--- a/proxy/logging/Log.cc
+++ b/proxy/logging/Log.cc
@@ -1075,23 +1075,6 @@ Log::create_threads()
     sprintf(desc, "[LOG_FLUSH]");
     eventProcessor.spawn_thread(flush_cont, desc, stacksize);
 
-#if !defined(IOCORE_LOG_COLLATION)
-    // start the collation thread if we are not using iocore log collation
-    //
-    // for the collation thread, we start one on each machine (done here)
-    // and then block it on a mutex variable that is only released (from
-    // LogConfig) on the machine configured to be the collation server.
-    // When it is no longer needed (say after a reconfiguration), it will
-    // be blocked again on it's condition variable.  This makes it easy to
-    // start and stop the collation thread, and assumes that there is not
-    // much overhead associated with keeping an ink_thread blocked on a
-    // condition variable.
-    //
-    Continuation *collate_continuation = NEW(new LoggingCollateContinuation);
-    sprintf(desc, "[LOG_COLLATION]");
-    Event *collate_event = eventProcessor.spawn_thread(collate_continuation, desc);
-    collate_thread = collate_event->ethread->tid;
-#endif
     init_status |= THREADS_CREATED;
   }
 }

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/c078edfc/proxy/logging/LogConfig.cc
----------------------------------------------------------------------
diff --git a/proxy/logging/LogConfig.cc b/proxy/logging/LogConfig.cc
index 9c8e28e..616776a 100644
--- a/proxy/logging/LogConfig.cc
+++ b/proxy/logging/LogConfig.cc
@@ -48,9 +48,7 @@
 #include "Log.h"
 #include "SimpleTokenizer.h"
 
-#if defined(IOCORE_LOG_COLLATION)
 #include "LogCollationAccept.h"
-#endif
 
 #define DISK_IS_CONFIG_FULL_MESSAGE \
     "Access logging to local log directory suspended - " \
@@ -540,9 +538,7 @@ LogConfig::LogConfig()
   : initialized(false),
     reconfiguration_needed(false),
     logging_space_exhausted(false), m_space_used(0), m_partition_space_left((int64_t) UINT_MAX),
-#if defined (IOCORE_LOG_COLLATION)
     m_log_collation_accept(NULL),
-#endif
     m_dir_entry(NULL),
     m_pDir(NULL),
     m_disk_full(false),
@@ -564,12 +560,10 @@ LogConfig::LogConfig()
 LogConfig::~LogConfig()
 {
 
-#if defined(IOCORE_LOG_COLLATION)
 // we don't delete the log collation accept because it may be transferred
 // to another LogConfig object
 //
 //    delete m_log_collation_accept;
-#endif
 
   ats_free(hostname);
   ats_free(logfile_dir);
@@ -619,7 +613,6 @@ LogConfig::setup_collation(LogConfig * prev_config)
       Note("Cannot activate log collation, \"%s\" is and invalid " "collation host", collation_host);
     } else {
       if (collation_mode == COLLATION_HOST) {
-#if defined(IOCORE_LOG_COLLATION)
 
         ink_assert(m_log_collation_accept == 0);
 
@@ -635,23 +628,13 @@ LogConfig::setup_collation(LogConfig * prev_config)
           Log::collation_port = collation_port;
           m_log_collation_accept = NEW(new LogCollationAccept(collation_port));
         }
-#else
-        // since we are the collation host, we need to signal the
-        // collate_cond variable so that our collation thread wakes up.
-        //
-        Log::collate_notify.signal();
-#endif
         Debug("log", "I am a collation host listening on port %d.", collation_port);
       } else {
         Debug("log", "I am a collation client (%d)."
               " My collation host is %s:%d", collation_mode, collation_host, collation_port);
       }
 
-#ifdef IOCORE_LOG_COLLATION
       Debug("log", "using iocore log collation");
-#else
-      Debug("log", "using socket log collation");
-#endif
       if (collation_host_tagged) {
         LogFormat::turn_tagging_on();
       } else {

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/c078edfc/proxy/logging/LogConfig.h
----------------------------------------------------------------------
diff --git a/proxy/logging/LogConfig.h b/proxy/logging/LogConfig.h
index f715e8c..2dc5bc6 100644
--- a/proxy/logging/LogConfig.h
+++ b/proxy/logging/LogConfig.h
@@ -76,9 +76,7 @@ extern RecRawStatBlock *log_rsb;
 
 struct dirent;
 
-#if defined(IOCORE_LOG_COLLATION)
 struct LogCollationAccept;
-#endif
 
 /*-------------------------------------------------------------------------
   LogConfig
@@ -290,9 +288,7 @@ private:
   //
   bool use_orphan_log_space_value;
 
-#if defined(IOCORE_LOG_COLLATION)
   LogCollationAccept *m_log_collation_accept;
-#endif
 
   struct dirent *m_dir_entry;
   char *m_pDir;

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/c078edfc/proxy/logging/LogHost.cc
----------------------------------------------------------------------
diff --git a/proxy/logging/LogHost.cc b/proxy/logging/LogHost.cc
index 05e9f28..3fd8c87 100644
--- a/proxy/logging/LogHost.cc
+++ b/proxy/logging/LogHost.cc
@@ -42,9 +42,7 @@
 #include "LogConfig.h"
 #include "Log.h"
 
-#if defined(IOCORE_LOG_COLLATION)
 #include "LogCollationClientSM.h"
-#endif
 
 #define PING 	true
 #define NOPING 	false
@@ -62,9 +60,7 @@ LogHost::LogHost(char *object_filename, uint64_t object_signature)
     m_sock_fd(-1),
     m_connected(false),
     m_orphan_file(NULL)
-#if defined (IOCORE_LOG_COLLATION)
   , m_log_collation_client_sm(NULL)
-#endif
 {
   ink_zero(m_ip);
   ink_zero(m_ipstr);
@@ -80,9 +76,7 @@ LogHost::LogHost(const LogHost & rhs)
     m_sock_fd(-1),
     m_connected(false),
     m_orphan_file(NULL)
-#if defined (IOCORE_LOG_COLLATION)
   , m_log_collation_client_sm(NULL)
-#endif
 {
   memcpy(m_ipstr, rhs.m_ipstr, sizeof(m_ipstr));
   create_orphan_LogFile_object();
@@ -111,13 +105,6 @@ LogHost::set_name_port(char *hostname, unsigned int pt)
 
   clear();                      // remove all previous state for this LogHost
 
-#if !defined(IOCORE_LOG_COLLATION)
-  IpEndpoint ip4, ip6;
-  m_ip.invalidate();
-  if (0 == ats_ip_getbestaddrinfo(hostname, &ip4, &ip6))
-    m_ip.assign(ip4.isIp4() ? &ip4 : &ip6)
-  m_ip.toString(m_ipstr, sizeof m_ipstr);
-#endif
   m_name = ats_strdup(hostname);
   m_port = pt;
 
@@ -284,36 +271,6 @@ LogHost::preproc_and_try_delete (LogBuffer *lb)
     goto done;
   }
 
-#if !defined(IOCORE_LOG_COLLATION)
-
-  // make sure we're connected & authenticated
-
-  if (!connected(NOPING)) {
-    if (!connect ()) {
-      Note("Cannot write LogBuffer to LogHost %s; not connected", name());
-      orphan_write_and_try_delete(lb);
-      return -1;
-    }
-  }
-
-  // try sending the logbuffer
-
-  int bytes_to_send, bytes_sent;
-  bytes_to_send = buffer_header->byte_count;
-  // lb->convert_to_network_order();
-  bytes_sent = m_sock->write (m_sock_fd, buffer_header, bytes_to_send);
-  if (bytes_to_send != bytes_sent) {
-    Note("Bad write to LogHost %s; bad send count %d/%d",
-        name(), bytes_sent, bytes_to_send);
-    disconnect();
-    // TODO: We currently don't try to make the log buffers handle little vs big endian. TS-1156.
-    // lb->convert_to_host_order ();
-    orphan_write_and_try_delete(lb);
-    return -1;
-  }
-  ret = 0;
-
-#else // !defined(IOCORE_LOG_COLLATION)
   // create a new collation client if necessary
   if (m_log_collation_client_sm == NULL) {
     m_log_collation_client_sm = NEW(new LogCollationClientSM(this));
@@ -332,7 +289,6 @@ LogHost::preproc_and_try_delete (LogBuffer *lb)
   }
 
   return 0;
-#endif // !defined(IOCORE_LOG_COLLATION)
 
 done:
   LogBuffer::destroy(lb);

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/c078edfc/proxy/logging/LogHost.h
----------------------------------------------------------------------
diff --git a/proxy/logging/LogHost.h b/proxy/logging/LogHost.h
index 55588d9..5aa32e5 100644
--- a/proxy/logging/LogHost.h
+++ b/proxy/logging/LogHost.h
@@ -36,9 +36,7 @@ class LogCollationClientSM;
 class LogHost
 {
 
-//#if defined(IOCORE_LOG_COLLATION)
   friend class LogCollationClientSM;
-//#endif
 
 public:
   LogHost(char *object_filename, uint64_t object_signature);
@@ -90,9 +88,7 @@ private:
   int m_sock_fd;
   bool m_connected;
   LogFile *m_orphan_file;
-#if defined(IOCORE_LOG_COLLATION)
   LogCollationClientSM *m_log_collation_client_sm;
-#endif
 
 public:
   LINK(LogHost, link);

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/c078edfc/proxy/logging/Makefile.am
----------------------------------------------------------------------
diff --git a/proxy/logging/Makefile.am b/proxy/logging/Makefile.am
index 14df7a0..d2f67b0 100644
--- a/proxy/logging/Makefile.am
+++ b/proxy/logging/Makefile.am
@@ -16,8 +16,6 @@
 #  See the License for the specific language governing permissions and
 #  limitations under the License.
 
-DEFS += -DIOCORE_LOG_COLLATION
-
 AM_CPPFLAGS = \
   $(iocore_include_dirs) \
   -I$(top_srcdir)/lib \