traeak commented on code in PR #13611:
URL: https://github.com/apache/trafficserver/pull/13611#discussion_r3960109795


##########
src/proxy/http/HttpSM.cc:
##########
@@ -5339,8 +5347,39 @@ HttpSM::do_cache_delete_all_alts()
   SMDbg(dbg_ctl_http_seq, "Issuing cache delete for %s", 
t_state.cache_info.lookup_url->string_get_ref());
 
   HttpCacheKey key;
-  Cache::generate_key(&key, t_state.cache_info.lookup_url, 
t_state.txn_conf->cache_ignore_query,
-                      t_state.txn_conf->cache_generation_number);
+  if (should_use_compatibility_cache_key(compatibility_cache_lookup)) {
+    Cache::generate_key92(&key, t_state.cache_info.lookup_url, 
t_state.txn_conf->cache_ignore_query,
+                          t_state.txn_conf->cache_generation_number);
+  } else {
+    Cache::generate_key(&key, t_state.cache_info.lookup_url, 
t_state.txn_conf->cache_ignore_query,
+                        t_state.txn_conf->cache_generation_number);
+  }
+  cacheProcessor.remove(nullptr, &key);
+}
+
+// Remove the object stored under the legacy key.
+//
+// Only for the cases that abort the canonical-key write, where nothing is left
+// depending on it. A successful migration deliberately leaves the legacy copy
+// alone: VC_EVENT_WRITE_COMPLETE means the tunnel handed the last byte to the
+// cache VC, not that the object reached disk, so deleting on that signal loses
+// the object outright whenever the write later fails. The copy ages out on its
+// own, and it stops being read as soon as the canonical key resolves, so the
+// compat_key_reads metric still decays to zero.
+void
+HttpSM::do_cache_delete_compat_alts()
+{
+  ink_assert(should_use_compatibility_cache_key(compatibility_cache_lookup));
+
+  URL *url = t_state.cache_info.lookup_url;
+
+  if (url == nullptr || !url->valid()) {
+    return;
+  }
+  SMDbg(dbg_ctl_http_seq, "Issuing compatibility cache delete for %s", 
url->string_get_ref());
+
+  HttpCacheKey key;
+  Cache::generate_key92(&key, url, t_state.txn_conf->cache_ignore_query, 
t_state.txn_conf->cache_generation_number);
   cacheProcessor.remove(nullptr, &key);

Review Comment:
   fixed



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to