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

oknet pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/trafficserver.git


The following commit(s) were added to refs/heads/master by this push:
     new a7a24cc   fix 3939 collision
a7a24cc is described below

commit a7a24cce324740609fdfcfa5aaee8f5504521294
Author: chenggang7 <chengga...@staff.sina.com.cn>
AuthorDate: Thu Apr 25 10:44:58 2019 +0800

     fix 3939 collision
---
 iocore/cache/CacheWrite.cc | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/iocore/cache/CacheWrite.cc b/iocore/cache/CacheWrite.cc
index 55ec3eb..59c101c 100644
--- a/iocore/cache/CacheWrite.cc
+++ b/iocore/cache/CacheWrite.cc
@@ -780,7 +780,13 @@ agg_copy(char *p, CacheVC *vc)
       if (doc->data_len() || vc->f.allow_empty_doc) {
         doc->key = vc->earliest_key;
       } else { // the vector is being written by itself
-        prev_CacheKey(&doc->key, &vc->earliest_key);
+        if (vc->earliest_key == zero_key) {
+          do {
+            rand_CacheKey(&doc->key, vc->vol->mutex);
+          } while (DIR_MASK_TAG(doc->key.slice32(2)) == 
DIR_MASK_TAG(vc->first_key.slice32(2)));
+        } else {
+          prev_CacheKey(&doc->key, &vc->earliest_key);
+        }
       }
       dir_set_head(&vc->dir, true);
     } else {

Reply via email to