trafficserver-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From zw...@apache.org
Subject svn commit: r1068981 - in /trafficserver/traffic/trunk: ./ contrib/perl/AdminClient/lib/Apache/TS/ iocore/cache/ mgmt/ proxy/ proxy/config/ proxy/http/
Date Wed, 09 Feb 2011 17:10:29 GMT
Author: zwoop
Date: Wed Feb  9 17:10:29 2011
New Revision: 1068981

URL: http://svn.apache.org/viewvc?rev=1068981&view=rev
Log:
TS-489 Remove the "connection collapsing" feature.

This was poorly implemented, and caused major problem if enabled. We should
redo this for v3.1 in a way that fits with the HttpSM.

Author: mohan_zl
Review: leif

Removed:
    trafficserver/traffic/trunk/proxy/http/Hash_Table.cc
    trafficserver/traffic/trunk/proxy/http/Hash_Table.h
Modified:
    trafficserver/traffic/trunk/CHANGES
    trafficserver/traffic/trunk/contrib/perl/AdminClient/lib/Apache/TS/AdminClient.pm
    trafficserver/traffic/trunk/iocore/cache/I_Cache.h
    trafficserver/traffic/trunk/mgmt/RecordsConfig.cc
    trafficserver/traffic/trunk/proxy/Main.cc
    trafficserver/traffic/trunk/proxy/config/records.config.in
    trafficserver/traffic/trunk/proxy/http/HttpConfig.cc
    trafficserver/traffic/trunk/proxy/http/HttpConfig.h
    trafficserver/traffic/trunk/proxy/http/HttpSM.cc
    trafficserver/traffic/trunk/proxy/http/HttpSM.h
    trafficserver/traffic/trunk/proxy/http/HttpTransact.cc
    trafficserver/traffic/trunk/proxy/http/HttpTransact.h
    trafficserver/traffic/trunk/proxy/http/Makefile.am

Modified: trafficserver/traffic/trunk/CHANGES
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/CHANGES?rev=1068981&r1=1068980&r2=1068981&view=diff
==============================================================================
--- trafficserver/traffic/trunk/CHANGES (original)
+++ trafficserver/traffic/trunk/CHANGES Wed Feb  9 17:10:29 2011
@@ -2,6 +2,17 @@
 
 Changes with Apache Traffic Server 2.1.6
 
+  *) [TS-489] Remove the "connection collapsing" feature, it was poorly
+   implemented, and caused major problem if enabled. We should redo this
+   for v3.1 in a way that fits with the HttpSM [author: mohan_zl].
+
+  *) [TS-668] Add support for URL stats to traffic_logstats.
+
+  *) [TS-665] Remove HTTP_ASSERT from the code base, use standard asserts.
+
+  *) [TS-663, TS-664] Fixes to WCCP with mask assignments, and trunk build
+   problems.
+
   *) [TS-662] Make per partition stats for bytes_used work.
 
   *) [TS-661] Delay the copy of per transaction configs until a plugin

Modified: trafficserver/traffic/trunk/contrib/perl/AdminClient/lib/Apache/TS/AdminClient.pm
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/contrib/perl/AdminClient/lib/Apache/TS/AdminClient.pm?rev=1068981&r1=1068980&r2=1068981&view=diff
==============================================================================
--- trafficserver/traffic/trunk/contrib/perl/AdminClient/lib/Apache/TS/AdminClient.pm (original)
+++ trafficserver/traffic/trunk/contrib/perl/AdminClient/lib/Apache/TS/AdminClient.pm Wed
Feb  9 17:10:29 2011
@@ -334,9 +334,6 @@ The Apache Traffic Server Administration
  proxy.config.cluster.sock_option_flag
  proxy.config.cluster.startup_timeout
  proxy.config.config_dir
- proxy.config.connection_collapsing.hashtable_enabled
- proxy.config.connection_collapsing.revalidate_window_period
- proxy.config.connection_collapsing.rww_wait_time
  proxy.config.cop.core_signal
  proxy.config.cop.linux_min_memfree_kb
  proxy.config.cop.linux_min_swapfree_kb

Modified: trafficserver/traffic/trunk/iocore/cache/I_Cache.h
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/iocore/cache/I_Cache.h?rev=1068981&r1=1068980&r2=1068981&view=diff
==============================================================================
--- trafficserver/traffic/trunk/iocore/cache/I_Cache.h (original)
+++ trafficserver/traffic/trunk/iocore/cache/I_Cache.h Wed Feb  9 17:10:29 2011
@@ -34,10 +34,6 @@
 #include "I_CacheDefs.h"
 #include "I_Store.h"
 
-#ifdef HTTP_CACHE
-#include "../../proxy/http/Hash_Table.h"       //Added to get the scope of hash table - YTS
Team, yamsat
-#endif
-
 #define CACHE_MODULE_MAJOR_VERSION 1
 #define CACHE_MODULE_MINOR_VERSION 0
 #define CACHE_MODULE_VERSION       makeModuleVersion(CACHE_MODULE_MAJOR_VERSION,\
@@ -149,9 +145,6 @@ struct CacheProcessor:public Processor
   static int fix;
   static int start_internal_flags;
   static int auto_clear_flag;
-#ifdef HTTP_CACHE
-  HashTable hashtable_tracker;  //Object declaration for hash table  - YTS Team, yamsat
-#endif
 };
 
 struct CacheVConnection:public VConnection

Modified: trafficserver/traffic/trunk/mgmt/RecordsConfig.cc
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/mgmt/RecordsConfig.cc?rev=1068981&r1=1068980&r2=1068981&view=diff
==============================================================================
--- trafficserver/traffic/trunk/mgmt/RecordsConfig.cc (original)
+++ trafficserver/traffic/trunk/mgmt/RecordsConfig.cc Wed Feb  9 17:10:29 2011
@@ -138,27 +138,6 @@ RecordElement RecordsConfig[] = {
 
   //##############################################################################
   //#
-  //# Connection Collapsing
-  //#
-  //# 1. hashtable_enabled: if set to 1, requests will first search the
-  //#    hashtable to see if another similar request is already being served.
-  //# 2. rww_wait_time: read-while-write wait time: While read while write is
-  //#    enabled, the secondary clients will wait this amount of time after which
-  //#    cache lookup is retried.
-  //# 3. revaildate_window_period: while revaidation of a cached object is being
-  //#    done, the secondary clients for the same url will serve the stale object for
-  //#    this amount of time, after the revalidation had started.
-  //#
-  //##############################################################################
-  {RECT_CONFIG, "proxy.config.connection_collapsing.hashtable_enabled", RECD_INT, "0", RECU_DYNAMIC,
RR_NULL, RECC_INT, "[0-1]", RECA_NULL}
-  ,
-  {RECT_CONFIG, "proxy.config.connection_collapsing.rww_wait_time", RECD_INT, "0", RECU_DYNAMIC,
RR_NULL, RECC_NULL, NULL, RECA_NULL}
-  ,
-  {RECT_CONFIG, "proxy.config.connection_collapsing.revalidate_window_period", RECD_INT,
"0", RECU_DYNAMIC, RR_NULL, RECC_NULL, NULL, RECA_NULL}
-  ,
-
-  //##############################################################################
-  //#
   //# Support for SRV records
   //#
   //##############################################################################

Modified: trafficserver/traffic/trunk/proxy/Main.cc
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/proxy/Main.cc?rev=1068981&r1=1068980&r2=1068981&view=diff
==============================================================================
--- trafficserver/traffic/trunk/proxy/Main.cc (original)
+++ trafficserver/traffic/trunk/proxy/Main.cc Wed Feb  9 17:10:29 2011
@@ -1901,11 +1901,6 @@ main(int argc, char **argv)
 
     if (http_enabled) {
       start_HttpProxyServer(http_accept_file_descriptor, http_accept_port_number, ssl_accept_file_descriptor,
num_accept_threads);
-      int hashtable_enabled = 0;
-      TS_ReadConfigInteger(hashtable_enabled, "proxy.config.connection_collapsing.hashtable_enabled");
-      if (hashtable_enabled) {
-        cacheProcessor.hashtable_tracker.createHashTable();
-      }
     }
 #ifndef INK_NO_ICP
     icpProcessor.start();

Modified: trafficserver/traffic/trunk/proxy/config/records.config.in
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/proxy/config/records.config.in?rev=1068981&r1=1068980&r2=1068981&view=diff
==============================================================================
--- trafficserver/traffic/trunk/proxy/config/records.config.in (original)
+++ trafficserver/traffic/trunk/proxy/config/records.config.in Wed Feb  9 17:10:29 2011
@@ -588,16 +588,6 @@ CONFIG proxy.config.core_limit INT -1
 CONFIG proxy.config.auth.enabled INT 0
 ##############################################################################
 #
-# Connection Collapsing
-#
-##############################################################################
-  # Adds the ability to collapse connections going to the origin server
-  # see Admin Guide Addendum for more details
-CONFIG proxy.config.connection_collapsing.hashtable_enabled INT 0
-CONFIG proxy.config.connection_collapsing.rww_wait_time INT 0
-CONFIG proxy.config.connection_collapsing.revalidate_window_period INT 0
-##############################################################################
-#
 # Debugging
 #
 ##############################################################################

Modified: trafficserver/traffic/trunk/proxy/http/HttpConfig.cc
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/proxy/http/HttpConfig.cc?rev=1068981&r1=1068980&r2=1068981&view=diff
==============================================================================
--- trafficserver/traffic/trunk/proxy/http/HttpConfig.cc (original)
+++ trafficserver/traffic/trunk/proxy/http/HttpConfig.cc Wed Feb  9 17:10:29 2011
@@ -1361,28 +1361,6 @@ HttpConfig::startup()
   // Stat Page Info
   HttpEstablishStaticConfigLongLong(c.enable_http_info, "proxy.config.http.enable_http_info");
 
-
-  ///////////////////////////////////////////////////////////////////////////
-  //   Added by YTS Team, yamsat                                                //
-  //   Connection collapsing Configuration parameters                      //
-  // 1. hashtable_enabled: if set to 1, requests will first search the     //
-  //    hashtable to see if another similar request is already being served//
-  // 2. rww_wait_time: read-while-write wait time: While read while write  //
-  //    is enabled, the secondary clients will wait this amount of time    //
-  //    after which cache lookup is retried                                //
-  // 3. revaildate_window_period: while revaidation of a cached object is  //
-  //    being done, the secondary clients for the same url will serve the  //
-  //    stale object for this amount of time, after the revalidation had   //
-  //    started                                                            //
-  ///////////////////////////////////////////////////////////////////////////
-
-  HttpEstablishStaticConfigLongLong(c.hashtable_enabled, "proxy.config.connection_collapsing.hashtable_enabled");
-
-  HttpEstablishStaticConfigLongLong(c.rww_wait_time, "proxy.config.connection_collapsing.rww_wait_time");
-
-  HttpEstablishStaticConfigLongLong(c.revalidate_window_period,
-                                    "proxy.config.connection_collapsing.revalidate_window_period");
-
   HttpEstablishStaticConfigLongLong(c.srv_enabled, "proxy.config.srv_enabled");
 
   //##############################################################################
@@ -1630,24 +1608,6 @@ HttpConfig::reconfigure()
   params->oride.negative_caching_enabled = m_master.oride.negative_caching_enabled;
   params->oride.negative_caching_lifetime = m_master.oride.negative_caching_lifetime;
 
-  ///////////////////////////////////////////////////////////////////////////
-  //  Added by YTS Team, yamsat                                                 //
-  //   Connection collapsing Configuration parameters                      //
-  // 1. hashtable_enabled: if set to 1, requests will first search the     //
-  //    hashtable to see if another similar request is already being served//
-  // 2. rww_wait_time: read-while-write wait time: While read while write  //
-  //    is enabled, the secondary clients will wait this amount of time    //
-  //    after which cache lookup is retried                                //
-  // 3. revaildate_window_period: while revaidation of a cached object is  //
-  //    being done, the secondary clients for the same url will serve the  //
-  //    stale object for this amount of time, after the revalidation had   //
-  //    started                                                            //
-  ///////////////////////////////////////////////////////////////////////////
-
-  params->hashtable_enabled = INT_TO_BOOL(m_master.hashtable_enabled);
-  params->rww_wait_time = m_master.rww_wait_time;
-  params->revalidate_window_period = m_master.revalidate_window_period;
-
   //##############################################################################
   //#
   //# Redirection
@@ -1666,12 +1626,6 @@ HttpConfig::reconfigure()
 
 #undef INT_TO_BOOL
 
-// Connection collapsing debug statements
-  Debug("http_init", "proxy.config.connection_collapsing.hashtable_enabled = %d", params->hashtable_enabled);
-  Debug("http_init", "proxy.config.connection_collapsing.rww_wait_time = %d", params->rww_wait_time);
-  Debug("http_init", "proxy.config.connection_collapsing.revalidate_window_period = %d",
-        params->revalidate_window_period);
-
 // Redirection debug statements
   Debug("http_init", "proxy.config.http.redirection_enabled = %d", params->redirection_enabled);
   Debug("http_init", "proxy.config.http.number_of_redirections = %d", params->number_of_redirections);

Modified: trafficserver/traffic/trunk/proxy/http/HttpConfig.h
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/proxy/http/HttpConfig.h?rev=1068981&r1=1068980&r2=1068981&view=diff
==============================================================================
--- trafficserver/traffic/trunk/proxy/http/HttpConfig.h (original)
+++ trafficserver/traffic/trunk/proxy/http/HttpConfig.h Wed Feb  9 17:10:29 2011
@@ -774,23 +774,6 @@ public:
   //  rather it is the time skew which the manager observes
   int32_t cluster_time_delta;
 
-  ///////////////////////////////////////////////////////////////////////////
-  // Added by YTS Team, yamsat                                                  //
-  //   Connection collapsing Configuration parameters                      //
-  // 1. hashtable_enabled: if set to 1, requests will first search the     //
-  //    hashtable to see if another similar request is already being served//
-  // 2. rww_wait_time: read-while-write wait time: While read while write  //
-  //    is enabled, the secondary clients will wait this amount of time    //
-  //    after which cache lookup is retried                                //
-  // 3. revaildate_window_period: while revaidation of a cached object is  //
-  //    being done, the secondary clients for the same url will serve the  //
-  //    stale object for this amount of time, after the revalidation had   //
-  //    started                                                            //
-  ///////////////////////////////////////////////////////////////////////////
-
-  MgmtInt hashtable_enabled;
-  MgmtInt rww_wait_time;
-  MgmtInt revalidate_window_period;
   MgmtInt srv_enabled;          /* added by: ebalsa */
 
   //##############################################################################
@@ -988,10 +971,6 @@ HttpConfigParams::HttpConfigParams()
     enable_http_info(0),
     fwd_proxy_auth_to_parent(0),
     cluster_time_delta(0),
-    //Added by YTS Team, yamsat
-    hashtable_enabled(false),
-    rww_wait_time(0),
-    revalidate_window_period(0),
     srv_enabled(0),
     redirection_enabled(true),
     number_of_redirections(0),

Modified: trafficserver/traffic/trunk/proxy/http/HttpSM.cc
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/proxy/http/HttpSM.cc?rev=1068981&r1=1068980&r2=1068981&view=diff
==============================================================================
--- trafficserver/traffic/trunk/proxy/http/HttpSM.cc (original)
+++ trafficserver/traffic/trunk/proxy/http/HttpSM.cc Wed Feb  9 17:10:29 2011
@@ -311,9 +311,6 @@ HttpSM::HttpSM()
     //YTS Team, yamsat Plugin
     enable_redirection(false), api_enable_redirection(true), redirect_url(NULL), redirect_url_len(0),
redirection_tries(0), transfered_bytes(0),
     post_failed(false),
-    //YTS Team, yamsat
-    is_cache_enabled(false), request_inserted(false),
-    Hashtable_index(0), piggybacking_scheduled(false), event_scheduled(NULL),
     plugin_tunnel_type(HTTP_NO_PLUGIN_TUNNEL),
     plugin_tunnel(NULL), reentrancy_count(0),
     history_pos(0), tunnel(), ua_entry(NULL),
@@ -442,21 +439,6 @@ HttpSM::init()
 
 }
 
-
-//Added by YTS Team, yamsat
-//This callback function is called by eventsystem if it has been scheduled.
-//This function enables the SM to do a CACHE-LOOKUP by calling DecideCacheLookup
-
-int
-HttpSM::connection_collapsing_piggyback_handler(int event, void *data)
-{
-  NOWARN_UNUSED(event);
-  NOWARN_UNUSED(data);
-  Debug("http_track", "HttpSM:connection_collapsing_piggyback_handler[%d]\n", sm_id);
-  call_transact_and_set_next_state(&HttpTransact::DecideCacheLookup);
-  return 0;
-}
-
 bool
 HttpSM::decide_cached_url(URL * s_url)
 {
@@ -603,9 +585,6 @@ HttpSM::start_sub_sm()
   tunnel.init(this, mutex);
   cache_sm.init(this, mutex);
   transform_cache_sm.init(this, mutex);
-  if (cacheProcessor.IsCacheEnabled() == 1) {   //To check if cache is enabled
-    is_cache_enabled = true;
-  }
 }
 
 void
@@ -2261,9 +2240,9 @@ HttpSM::state_icp_lookup(int event, void
 *
 *  // inhibit bad ICP looping behavior
 *  if (t_state.icp_ip_result.sin_addr.s_addr ==
-*	  t_state.client_info.ip) {
-*	    Debug("http","Loop in ICP config, bypassing...");
-* 	    t_state.icp_lookup_success = false;
+*    t_state.client_info.ip) {
+*      Debug("http","Loop in ICP config, bypassing...");
+*        t_state.icp_lookup_success = false;
 *  }
 */
     break;
@@ -2438,7 +2417,7 @@ HttpSM::main_handler(int event, void *da
 {
   ink_release_assert(magic == HTTP_SM_MAGIC_ALIVE);
 
-  HttpSMHandler jump_point;
+  HttpSMHandler jump_point = NULL;
   ink_assert(reentrancy_count >= 0);
   reentrancy_count++;
 
@@ -2452,30 +2431,13 @@ HttpSM::main_handler(int event, void *da
     // Only search the VC table if the event could have to
     //  do with a VIO to save a few cycles
 
-    //Added by YTS Team, yamsat
-    // If piggybacking is scheduled and the incoming event is not VC_EVENT_INTERVAL
-    // then skip finding the vc_entry. If the event is VC_EVENT_INTERVAL, then find
-    // the appr. vc_entry and nullify the event_scheduled.
-
     if (event < VC_EVENT_EVENTS_START + 100) {
-      if (piggybacking_scheduled && (event != 104)) {
-        vc_entry = vc_table.find_entry(ua_entry->read_vio);
-        event_scheduled = NULL;
-      } else
-        vc_entry = vc_table.find_entry((VIO *) data);
+      vc_entry = vc_table.find_entry((VIO *) data);
     }
   }
 
   if (vc_entry) {
-    //Added by YTS Team, yamsat
-    //if piggybacking is scheduled and the event arrived is VC_EVENT_INTERVAL
-    //Then set the jump_point to scheduled handler.This therefore calls the
-    //connection_collapsing_piggybacked_handler()
-    if (piggybacking_scheduled && event == 2) {
-      jump_point = vc_entry->piggybacking_scheduled_handler;
-    } else {
-      jump_point = vc_entry->vc_handler;
-    }
+    jump_point = vc_entry->vc_handler;
     ink_assert(jump_point != (HttpSMHandler)NULL);
     ink_assert(vc_entry->vc != (VConnection *)NULL);
     (this->*jump_point) (event, data);
@@ -3726,9 +3688,9 @@ HttpSM::do_hostdb_lookup()
     // is currently opened --- close it.    //
     //////////////////////////////////////////
     if (m_origin_server_vc != 0) {
-	origin_server_close(CLOSE_CONNECTION);
-	if (m_response_body_tunnel_buffer_.buf() != 0)
-	    m_response_body_tunnel_buffer_.reset();
+   origin_server_close(CLOSE_CONNECTION);
+   if (m_response_body_tunnel_buffer_.buf() != 0)
+       m_response_body_tunnel_buffer_.reset();
     }
     */
 
@@ -4096,8 +4058,7 @@ HttpSM::do_http_server_open(bool raw)
   // to be based on ua_session != NULL instead of req_flavor value.
   ink_assert(ua_entry != NULL ||
              t_state.req_flavor == HttpTransact::REQ_FLAVOR_SCHEDULED_UPDATE ||
-             t_state.req_flavor == HttpTransact::REQ_FLAVOR_REVPROXY
-	     );
+             t_state.req_flavor == HttpTransact::REQ_FLAVOR_REVPROXY);
 
   ink_assert(pending_action == NULL);
   ink_assert(t_state.current.server->port > 0);
@@ -5957,28 +5918,9 @@ void
 HttpSM::kill_this()
 {
   ink_release_assert(reentrancy_count == 1);
-
-  //Added by YTS Team, yamsat
-  //If piggybacking is scheduled, and in the mean time, there is an client collapse,
-  //then cancle the event in the event system
-  if (event_scheduled) {
-    event_scheduled->cancelled = 1;
-    event_scheduled = NULL;
-  }
   tunnel.deallocate_redirect_postdata_buffers();
   enable_redirection = false;
 
-  //Added by YTS Team, yamsat
-  // Deleting entry from the hashtable
-  if (is_cache_enabled && HttpConfig::m_master.hashtable_enabled && request_inserted)
{
-    char *request_data_str = t_state.request_data.get_string();
-    int index = cacheProcessor.hashtable_tracker.KeyToIndex(request_data_str);
-    if (cacheProcessor.hashtable_tracker.remove(index, request_data_str, RequestHeader))
{
-      Debug("http_track", "[HttpSM::kill_this]URL entry removed from Hashtable");
-    }
-    xfree(request_data_str);
-  }
-
   if (kill_this_async_done == false) {
     ////////////////////////////////
     // cancel uncompleted actions //
@@ -6149,9 +6091,9 @@ HttpSM::update_stats()
   }
 
 /*   Debug("ARMStatsCache", "ua_begin_write: %d ua_close: %d ua_write_time:%d",
-	  (int) ink_hrtime_to_msec(milestones.ua_begin_write),
-	  (int) ink_hrtime_to_msec(milestones.ua_close),
-	  (int) ink_hrtime_to_msec(ua_write_time));
+     (int) ink_hrtime_to_msec(milestones.ua_begin_write),
+     (int) ink_hrtime_to_msec(milestones.ua_close),
+     (int) ink_hrtime_to_msec(ua_write_time));
  */
 
   ink_hrtime os_read_time;
@@ -6443,7 +6385,7 @@ HttpSM::set_next_state()
         do_remap_request(false);        /* dont run inline (iow on another thread) */
       }
       break;
-    }  
+    }
   
   case HttpTransact::DNS_LOOKUP:
     {

Modified: trafficserver/traffic/trunk/proxy/http/HttpSM.h
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/proxy/http/HttpSM.h?rev=1068981&r1=1068980&r2=1068981&view=diff
==============================================================================
--- trafficserver/traffic/trunk/proxy/http/HttpSM.h (original)
+++ trafficserver/traffic/trunk/proxy/http/HttpSM.h Wed Feb  9 17:10:29 2011
@@ -102,7 +102,6 @@ struct HttpVCTableEntry
   VIO *read_vio;
   VIO *write_vio;
   HttpSMHandler vc_handler;
-  HttpSMHandler piggybacking_scheduled_handler; //The other scheduling handler for Conn Collapsing
- YTS Team, yamsat
   HttpVC_t vc_type;
   bool in_tunnel;
 };
@@ -272,13 +271,6 @@ public:
   int64_t transfered_bytes;         //Added to calculate POST data
   bool post_failed;             //Added to identify post failure
 
-  bool is_cache_enabled;        //To check if cache is enabled  - YTS Team, yamsat
-  bool request_inserted;        //To check if requested URL is inserted - YTS Team, yamsat
-  bool Hashtable_index;         //Storing the hash table index - YTS Team, yamsat
-  HeaderAlternate *RequestHeader;       //Pointer for request header - YTS Team, yamsat
-  bool piggybacking_scheduled;  //To check if piggy backing is scheduled - YTS Team, yamsat
-  Event *event_scheduled;       //YTS Team, yamsat
-
   // Tunneling request to plugin
   HttpPluginTunnel_t plugin_tunnel_type;
   PluginVCCore *plugin_tunnel;
@@ -305,8 +297,6 @@ protected:
   void remove_ua_entry();
 
 public:
-  //Handler for connection collapsing for Response-Cache-MISS case
-  int connection_collapsing_piggyback_handler(int, void *);     //YTS Team, yamsat
   HttpClientSession *ua_session;
   BackgroundFill_t background_fill;
   //AuthHttpAdapter authAdapter;

Modified: trafficserver/traffic/trunk/proxy/http/HttpTransact.cc
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/proxy/http/HttpTransact.cc?rev=1068981&r1=1068980&r2=1068981&view=diff
==============================================================================
--- trafficserver/traffic/trunk/proxy/http/HttpTransact.cc (original)
+++ trafficserver/traffic/trunk/proxy/http/HttpTransact.cc Wed Feb  9 17:10:29 2011
@@ -26,7 +26,6 @@
 #include <strings.h>
 #include <math.h>
 
-//#include "Hash_Table.h"
 #include "HttpTransact.h"
 #include "HttpTransactHeaders.h"
 #include "HttpSM.h"
@@ -47,8 +46,6 @@
 #include "HttpBodyFactory.h"
 #include "StatPages.h"
 #include "HttpClientSession.h"
-//#include "YAddr.h"
-#define REVALIDATE_CONV_FACTOR 1000000  //Revalidation Conversion Factor to msec - YTS Team,
yamsat
 #include "I_Machine.h"
 
 static const char *URL_MSG = "Unable to process requested URL.\n";
@@ -1496,7 +1493,6 @@ HttpTransact::OSDNSLookup(State* s)
 {
   static int max_dns_lookups = 3 + s->http_config_param->num_url_expansions;
   ++s->dns_info.attempts;
-  int return_action = 0;        // Return action - YTS Team, yamsat
 
   Debug("http_trans", "[HttpTransact::OSDNSLookup] This was attempt %d", s->dns_info.attempts);
 
@@ -1598,32 +1594,6 @@ HttpTransact::OSDNSLookup(State* s)
   Debug("http_trans", "[OSDNSLookup] DNS lookup for O.S. successful "
         "IP: %u.%u.%u.%u", PRINT_IP(s->server_info.ip));
 
-
-  //Added By YTS Team, yamsat
-
-  //As the object is a miss in Cache and DNS lookup done by this time
-  //lets check if there is someother client requesting for the same url
-  //by looking-up the HashTable.
-  //The return action would further be either scheduling for connection
-  //collapsing or doing a cache lookup again.
-  return_action = ConnectionCollapsing(s);
-
-  if (return_action == CONNECTION_COLLAPSING_SCHEDULED) {
-    // Changing the state from DNS_LOOKUP to STATE_MACHINE_ACTION_UNDEFINED
-    //As the handler has been scheduled, the event system would call back
-    //after rww_wait_time. So lets return to Zero state from here so that
-    //transaction starts afresh when piggybacked_handler is scheduled
-    //YTS Team, yamsat
-    TRANSACT_RETURN(STATE_MACHINE_ACTION_UNDEFINED, NULL);
-  }
-
-  else if (return_action == CACHE_RELOOKUP) {
-    //This case arises if a client could not insert an entry in Hash Table
-    //as someother url has inserted it.Therefore there is a possibility
-    //for this client to get the object from Cache instead of going to
-    //origin server connection -- YTS Team, yamsat
-    TRANSACT_RETURN(CACHE_LOOKUP, NULL);
-  }
   // so the dns lookup was a success, but the lookup succeeded on
   // a hostname which was expanded by the traffic server. we should
   // not automatically forward the request to this expanded hostname.
@@ -1771,7 +1741,7 @@ HttpTransact::DecideCacheLookup(State* s
     // the cache directly with the URL before the redirect
     s->cache_info.action = CACHE_DO_NO_ACTION;
     s->current.mode = GENERIC_PROXY;
-  } else if (!s->state_machine->piggybacking_scheduled) {       //Check if this process
is done - YTS Team, yamsat
+  } else {
     if (is_request_cache_lookupable(s, &s->hdr_info.client_request)) {
       s->cache_info.action = CACHE_DO_LOOKUP;
       s->current.mode = GENERIC_PROXY;
@@ -1780,10 +1750,6 @@ HttpTransact::DecideCacheLookup(State* s
       s->current.mode = TUNNELLING_PROXY;
       HTTP_INCREMENT_TRANS_STAT(http_tunnels_stat);
     }
-  } else {
-    s->cache_info.action = CACHE_DO_LOOKUP;
-    s->current.mode = GENERIC_PROXY;
-    s->state_machine->piggybacking_scheduled = false;
   }
 
   if (service_transaction_in_proxy_only_mode(s)) {
@@ -2442,7 +2408,6 @@ HttpTransact::HandleCacheOpenReadHit(Sta
   bool needs_cache_auth = false;
   bool server_up = true;
   CacheHTTPInfo *obj;
-  int return_action = 0;        // Return action for Connection Collapsing - YTS Team, yamsat
 
   if (s->api_update_cached_object == HttpTransact::UPDATE_CACHED_OBJECT_CONTINUE) {
     obj = &s->cache_info.object_store;
@@ -2525,28 +2490,6 @@ HttpTransact::HandleCacheOpenReadHit(Sta
     DebugOn("http_trans", "CacheOpenRead --- needs_cache_auth    = %d", needs_cache_auth);
     DebugOn("http_trans", "CacheOpenRead --- send_revalidate    = %d", send_revalidate);
   }
-  //Added by YTS Team, yamsat
-
-  //At this juncture, the object needs to be revalidated. But check if some other client
-  //is already in the process of revalidation. Looking-up hashtable will enable to find
-  //if someone's there.The foll cases arise
-  // 1) if URL inserted and revalidation_window_period not expired, then this client will
-  //    be served stale object.
-  // 2) if URL not found, then insert the URL and update the window_period.
-  //Both the above actions are done in ConnectionCollapsing_for_revalidation()
-  //Depending on the return type, set send_revalidate to false, or retain it to true.
-
-
-  //Check if hash table is enabled in config file
-  if (HttpConfig::m_master.hashtable_enabled && (s->state_machine->is_cache_enabled)
&& (s->is_revalidation_necessary)) {
-    return_action = ConnectionCollapsing_for_revalidation(s);
-
-    if (return_action == SERVE_STALE_OBJECT) {
-      //setting send_revalidate to false so as to serve stale object in cache
-      send_revalidate = false;
-    }
-  }                             // YTS Team, yamsat
-
   if (send_revalidate) {
     Debug("http_trans", "CacheOpenRead --- HIT-STALE");
     s->dns_info.attempts = 0;
@@ -4095,12 +4038,6 @@ HttpTransact::handle_cache_operation_on_
   if (diags->on()) {
     if (cacheable) {
       DebugOn("http_trans", "[hcoofsr] response cacheable");
-    } else {
-      if (s->state_machine->request_inserted) {
-        cacheProcessor.hashtable_tracker.set_response_noncacheable(s->state_machine->Hashtable_index,
-                                                                   s->state_machine->RequestHeader);
-      }
-      DebugOn("http_trans", "[hcoofsr] response not cacheable");
     }
   }
   // set the correct next action, cache action, response code, and base response
@@ -8950,164 +8887,3 @@ HttpTransact::delete_warning_value(HTTPH
     }
   }
 }
-
-
-////////////////////////////////////////////////////////////////////////////////////
-//
-// Name    : is_connection_collapse_checks_success
-//
-// Details : This function is used to check for the success of various connection
-//           collapsing parameters.Connection collapsing is disabled in the foll cases
-//              1) If Cache DISK not present
-//              2) If read_while_writing is disabled
-//              3) If request is Https
-//
-// YTS Team, yamsat
-////////////////////////////////////////////////////////////////////////////////////
-
-bool
-HttpTransact::is_connection_collapse_checks_success(State* s)
-{
-  bool match = true;
-  URL *url = s->hdr_info.client_request.url_get();
-  int rww_enabled = 0;
-
-  TS_ReadConfigInteger(rww_enabled, "proxy.config.cache.enable_read_while_writer");
-  match &= (url->scheme_get_wksidx() == URL_WKSIDX_HTTP);
-  match &= HttpConfig::m_master.hashtable_enabled;
-  match &= !(s->is_revalidation_necessary);
-  match &= s->state_machine->is_cache_enabled;
-  match &= rww_enabled;
-  return match;
-}
-
-////////////////////////////////////////////////////////////////////////////////////
-// Name         : ConnectionCollapsing
-//
-// Details      : This function is called from OSDNSLookup(). Checks if there is an
-//                ongoing transaction already in progress for the same object.This
-//                is done by looking-up the hashtable.There would be two cases here.
-//              1) If entry found, check if URL headers match perfectly. then return
-//                 for scheduling this client to be piggy backed.
-//              2) If entry not found in Hashtable, insert an entry and return with
-//                 status indicating normal procedure for connecting to OriginServer
-//              3) If entry could not be inserted,this means that there was someother
-//                 client who has inserted the request.Therefore, return with a status
-//                 indicating CACHE_RELOOKUP.Then, this client could get the object
-//                 from the cache because of the read-while-write behavior
-//
-// YTS Team, yamsat
-////////////////////////////////////////////////////////////////////////////////////
-int
-HttpTransact::ConnectionCollapsing(State* s)
-{
-  //Checking Hash table tries
-  if (s->HashTable_Tries == 0) {
-    s->HashTable_Tries++;
-    if (is_connection_collapse_checks_success(s)) {
-      char *url_str = s->request_data.get_string();
-      int index = cacheProcessor.hashtable_tracker.KeyToIndex(url_str);
-      HeaderAlternate *alternate = NULL;
-
-      alternate = cacheProcessor.hashtable_tracker.lookup(index, url_str, s->request_data.hdr);
-      xfree(url_str);
-
-      if (alternate != NULL) {
-        Debug("http_seq", "[HttpTransact::OSDNSLookup]URL entry found in HashTable");
-        if (!alternate->response_noncacheable && HttpConfig::m_master.rww_wait_time
!= 0) {
-          HttpVCTableEntry *ua_entry = s->state_machine->get_ua_entry();
-
-          //Registering vc_handler for scheduling
-          ua_entry->piggybacking_scheduled_handler = &HttpSM::connection_collapsing_piggyback_handler;
-          s->state_machine->piggybacking_scheduled = true;
-
-          //Scheduling the piggy backed clients to do Cache lookup
-          s->state_machine->event_scheduled =
-            s->state_machine->mutex->thread_holding->schedule_at(s->state_machine,
HRTIME_MSECONDS(HttpConfig::m_master.rww_wait_time));
-
-          return CONNECTION_COLLAPSING_SCHEDULED;
-        }
-      } else {
-        //Creating a Hash entry in the Hash table
-        if (NULL != (alternate = cacheProcessor.hashtable_tracker.insert(index, &s->request_data,
false))) {
-          s->state_machine->request_inserted = true;
-          s->state_machine->RequestHeader = alternate;
-          s->state_machine->Hashtable_index = index;
-          Debug("http_seq", "[HttpTransact::OSDNSLookup]Inserted URL entry in hashtable");
-        } else {
-          s->state_machine->request_inserted = false;
-          s->state_machine->RequestHeader = NULL;
-          xfree(alternate);
-          alternate = NULL;
-          return CACHE_RELOOKUP;
-        }
-      }
-    }
-  }
-  return 0;
-}
-
-///////////////////////////////////////////////////////////////////////////////////////////////
-//Name          : ConnectionCollapsing_for_revalidation
-//
-//Details       : This function is called from HandleCacheOpenReadHit(). If an object is
determined
-//                to be revalidated, check if there is some other client already in the process
-//                of revalidation.This is done by looking-up the HashTable.The foll cases
arise
-//              1) If URL found in HashTable, check if the revalidate_window_period is expired.
-//                 If yes, update the revalidation_start_time and proceed for OS connection.
-//                 If no, return a status indicating that stale object be served from CACHE.
-//              2) If URL not found,
-//                      * insert the url in the hashTable and update the revalidation_start_time
-//                         and return with the status indicating the connection to OS.
-//                      * if url not inserted, this means that there was someother client
who inserted
-//                        it and there is a possibility of avoiding a OS connection. Therefore,
return
-//                        with status indicating that stale object be served from CACHE.
-//
-// YTS Team, yamsat
-///////////////////////////////////////////////////////////////////////////////////////////////
-int
-HttpTransact::ConnectionCollapsing_for_revalidation(State* s)
-{
-  HeaderAlternate *alternate = NULL;
-
-  // TODO eval whether we should get a reference here
-  // except this getter also unescapes the string so maybe not...
-  char *url_str = s->request_data.get_string();
-
-  //Doing a Hashtable Lookup
-  int index = cacheProcessor.hashtable_tracker.KeyToIndex(url_str);
-
-  alternate = cacheProcessor.hashtable_tracker.lookup(index, url_str, s->request_data.hdr);
-  xfree(url_str);
-  if (alternate != NULL) {
-    Debug("http_seq", "[HttpTransact::HandleCacheOpenReadHit]URL entry found in HashTable");
-    if (alternate->revalidation_in_progress == true) {
-      //Checking if request is in revalidate_window_period
-      if (((ink_get_hrtime_internal() - (alternate->revalidation_start_time)) / REVALIDATE_CONV_FACTOR)
<
-          (HttpConfig::m_master.revalidate_window_period)) {
-        //setting send_revalidate to false so as to serve stale object in cache
-        return SERVE_STALE_OBJECT;
-      } else {
-        //Updating the revalidation_start_time
-        cacheProcessor.hashtable_tracker.update_revalidation_start_time(index, alternate);
-      }
-    }
-  }
-  //if URL not found ie. if Hash Table Miss....
-  else {
-    if (NULL != (alternate = cacheProcessor.hashtable_tracker.insert(index, &s->request_data,
true))) {
-      s->state_machine->request_inserted = true;
-      s->state_machine->RequestHeader = alternate;
-      s->state_machine->Hashtable_index = index;
-      Debug("http_seq", "[HttpTransact::HandleCacheOpenReadHit]Inserted URL entry in hashtable");
-    } else {
-      xfree(alternate);
-      s->state_machine->request_inserted = false;
-      s->state_machine->RequestHeader = NULL;
-      alternate = NULL;
-      return SERVE_STALE_OBJECT;
-    }
-  }
-  return 0;
-}
-

Modified: trafficserver/traffic/trunk/proxy/http/HttpTransact.h
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/proxy/http/HttpTransact.h?rev=1068981&r1=1068980&r2=1068981&view=diff
==============================================================================
--- trafficserver/traffic/trunk/proxy/http/HttpTransact.h (original)
+++ trafficserver/traffic/trunk/proxy/http/HttpTransact.h Wed Feb  9 17:10:29 2011
@@ -47,9 +47,6 @@
 #define MAX_DNS_LOOKUPS 2
 #define WUTS_PROXY_ID 0
 #define NUM_SECONDS_IN_ONE_YEAR (31536000)      // (365L * 24L * 3600L)
-#define CONNECTION_COLLAPSING_SCHEDULED 1       //YTS Team, yamsat
-#define CACHE_RELOOKUP 2        //YTS Team, yamsat
-#define SERVE_STALE_OBJECT 1    //YTS Team, yamsat
 
 #define HTTP_RELEASE_ASSERT(X) ink_release_assert(X)
 // #define ink_cluster_time(X) time(X)
@@ -1262,8 +1259,6 @@ public:
   static void LookupSkipOpenServer(State* s);
 
   static void CallOSDNSLookup(State* s);
-  static int ConnectionCollapsing(State* s);   //Added functionality for MISS cases - YTS
Team, yamsat
-  static int ConnectionCollapsing_for_revalidation(State* s);  //Added functionality for
REVALIDATION - YTS Team, yamsat
   static void OSDNSLookup(State* s);
   static void ReDNSRoundRobin(State* s);
   static void PPDNSLookup(State* s);

Modified: trafficserver/traffic/trunk/proxy/http/Makefile.am
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/proxy/http/Makefile.am?rev=1068981&r1=1068980&r2=1068981&view=diff
==============================================================================
--- trafficserver/traffic/trunk/proxy/http/Makefile.am (original)
+++ trafficserver/traffic/trunk/proxy/http/Makefile.am Wed Feb  9 17:10:29 2011
@@ -33,8 +33,6 @@ noinst_HEADERS = HttpProxyServerMain.h
 noinst_LIBRARIES = libhttp.a
 
 libhttp_a_SOURCES = \
-  Hash_Table.cc \
-  Hash_Table.h \
   HttpAccept.cc \
   HttpAccept.h \
   HttpBodyFactory.cc \



Mime
View raw message