From fedb0a72c492ed99547e3d012ba482230eb67532 Mon Sep 17 00:00:00 2001 From: Gustav Davidsson Date: Wed, 23 Oct 2024 11:02:04 -0700 Subject: allow stale in cache_vary_lookup --- .bleep | 2 +- pingora-cache/src/lib.rs | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.bleep b/.bleep index c522314..9678016 100644 --- a/.bleep +++ b/.bleep @@ -1 +1 @@ -a0e0694e1a76aea46e0c9b2ba50139be20a98364 \ No newline at end of file +68d99de4b93fec4149a15f323d03199a6e5f35ed \ No newline at end of file diff --git a/pingora-cache/src/lib.rs b/pingora-cache/src/lib.rs index 2aa2f7c..d484bfa 100644 --- a/pingora-cache/src/lib.rs +++ b/pingora-cache/src/lib.rs @@ -976,7 +976,8 @@ impl HttpCache { /// - return false if the current meta doesn't match the variance, need to cache_lookup() again pub fn cache_vary_lookup(&mut self, variance: HashBinary, meta: &CacheMeta) -> bool { match self.phase { - CachePhase::CacheKey => { + // Stale is allowed here because stale-> cache_lock -> lookup again + CachePhase::CacheKey | CachePhase::Stale => { let inner = self.inner_mut(); // make sure that all variances found are fresher than this asset // this is because when purging all the variance, only the primary slot is deleted -- cgit v1.2.3