This is an automated email from the ASF dual-hosted git repository.

zwoop pushed a commit to branch 8.1.x
in repository https://gitbox.apache.org/repos/asf/trafficserver.git


The following commit(s) were added to refs/heads/8.1.x by this push:
     new 2c819a2  Revert "Patch to catch and invalidate an HTTP asset with 
negative bytes after cache_seek."
2c819a2 is described below

commit 2c819a2be7e7538e4580db588f2a434eabc387c0
Author: Leif Hedstrom <zw...@apache.org>
AuthorDate: Thu Apr 9 13:37:56 2020 -0600

    Revert "Patch to catch and invalidate an HTTP asset with negative bytes 
after cache_seek."
    
    This reverts commit 826bd656c73b5292c8d221e38b130ad44ce6d467.
    
    This is not yet ready for prime time.
---
 iocore/cache/CacheRead.cc      | 57 ++----------------------------------------
 iocore/cache/P_CacheInternal.h |  1 -
 2 files changed, 2 insertions(+), 56 deletions(-)

diff --git a/iocore/cache/CacheRead.cc b/iocore/cache/CacheRead.cc
index 4bb3612..662a102 100644
--- a/iocore/cache/CacheRead.cc
+++ b/iocore/cache/CacheRead.cc
@@ -719,46 +719,8 @@ CacheVC::openReadMain(int /* event ATS_UNUSED */, Event * 
/* e ATS_UNUSED */)
     bytes     = doc->len - doc_pos;
     if (is_debug_tag_set("cache_seek")) {
       char target_key_str[CRYPTO_HEX_SIZE];
-      Debug("cache_seek", "Read # %d @ %" PRId64 "/%d for %" PRId64 " %s", 
fragment, doc_pos, doc->len, bytes,
-            key.toHexStr(target_key_str));
-    }
-
-    // This shouldn't happen for HTTP assets but it does
-    // occasionally in production. This is a temporary fix
-    // to clean up broken objects until the root cause can
-    // be found. It must be the case that either the fragment
-    // offsets are incorrect or a fragment table isn't being
-    // created when it should be.
-    if (frag_type == CACHE_FRAG_TYPE_HTTP && bytes < 0) {
-      char xt[CRYPTO_HEX_SIZE];
-      char yt[CRYPTO_HEX_SIZE];
-
-      int url_length       = 0;
-      char const *url_text = nullptr;
-      if (request.valid()) {
-        url_text = request.url_get()->string_get_ref(&url_length);
-      }
-
-      int64_t prev_frag_size = 0;
-      if (fragment && frags) {
-        prev_frag_size = static_cast<int64_t>(frags[fragment - 1]);
-      }
-
-      Warning("cache_seek range request bug: read %s targ %s - %s frag # %d 
(prev_frag %" PRId64 ") @ %" PRId64 "/%d for %" PRId64
-              " tot %" PRId64 " url '%.*s'",
-              doc->key.toHexStr(xt), key.toHexStr(yt), f.single_fragment ? 
"single" : "multi", fragment, prev_frag_size, doc_pos,
-              doc->len, bytes, doc->total_len, url_length, url_text);
-
-      doc->magic = DOC_CORRUPT;
-
-      CACHE_TRY_LOCK(lock, vol->mutex, mutex->thread_holding);
-      if (!lock.is_locked()) {
-        SET_HANDLER(&CacheVC::openReadDirDelete);
-        VC_SCHED_LOCK_RETRY();
-      }
-
-      dir_delete(&earliest_key, vol, &earliest_dir);
-      goto Lerror;
+      key.toHexStr(target_key_str);
+      Debug("cache_seek", "Read # %d @ %" PRId64 "/%d for %" PRId64, fragment, 
doc_pos, doc->len, bytes);
     }
   }
   if (ntodo <= 0) {
@@ -1258,18 +1220,3 @@ Learliest:
   SET_HANDLER(&CacheVC::openReadStartEarliest);
   return openReadStartEarliest(event, e);
 }
-
-/*
-   Handle a directory delete event in case of some detected corruption.
-*/
-int
-CacheVC::openReadDirDelete(int event, Event *e)
-{
-  MUTEX_TRY_LOCK(lock, vol->mutex, mutex->thread_holding);
-  if (!lock.is_locked()) {
-    VC_SCHED_LOCK_RETRY();
-  }
-
-  dir_delete(&earliest_key, vol, &earliest_dir);
-  return calluser(VC_EVENT_ERROR);
-}
diff --git a/iocore/cache/P_CacheInternal.h b/iocore/cache/P_CacheInternal.h
index 4e29bf5..d82aa34 100644
--- a/iocore/cache/P_CacheInternal.h
+++ b/iocore/cache/P_CacheInternal.h
@@ -326,7 +326,6 @@ struct CacheVC : public CacheVConnection {
   int openReadFromWriterMain(int event, Event *e);
   int openReadFromWriterFailure(int event, Event *);
   int openReadChooseWriter(int event, Event *e);
-  int openReadDirDelete(int event, Event *e);
 
   int openWriteCloseDir(int event, Event *e);
   int openWriteCloseHeadDone(int event, Event *e);

Reply via email to