0.34.6_repo_cleanup

This commit is contained in:
Mateusz Gruszczyński committed 2026-10-22 09:31:15 +02:00
1 parent ce1a90397c
commit 133d2f0f91
273 files changed
+5969 -6926

No files matched your search

-14
View File
@@ -83,14 +83,10 @@ enum CacheInvalidation {
Scopes(Vec<String>),
}
/// Global compatibility identity for HOT/COLD cache entries. Vhost-specific
/// representation changes use individual scope generations and COLD fingerprints.
/// Connection-pool/LB knobs do not enter either identity.
fn cache_revision(config: &config::Config) -> u64 {
let mut cache = config.cache.clone();
cache.memory_preset = None;
cache.cold_preset = None;
// These are request admission or response diagnostics, never stored objects.
cache.bypass_query = false;
cache.bypass_prefixes.clear();
cache.http_invalidation_allowed_cidrs.clear();
@@ -104,11 +100,8 @@ fn cache_revision(config: &config::Config) -> u64 {
transform.preset = None;
transform.memory_budget_bytes = 0;
transform.max_inflight = 0;
// Web services and FPM profiles can change the bytes served by a location.
// Until their dependency graph is split into scopes, invalidate globally.
let mut web_services = config.web_services.clone();
for service in &mut web_services {
// Kernel write strategy never changes the HTTP representation.
service.sendfile = crate::web_server::SendfileMode::Off;
}
cache_digest(&(
@@ -127,8 +120,6 @@ fn cache_digest<T: serde::Serialize>(value: &T) -> u64 {
u64::from_be_bytes(digest[..8].try_into().expect("sha256 prefix"))
}
/// Only effective origin/content policies contribute to this scope identity.
/// A vhost keepalive or load-balancer control save must retain both cache tiers.
fn vhost_cache_revision(vhost: &crate::vhost::Vhost) -> u64 {
let mut view = vhost.clone();
view.websockets = false;
@@ -159,9 +150,6 @@ fn vhost_cache_revision(vhost: &crate::vhost::Vhost) -> u64 {
view.proxy_timeouts = Default::default();
view.frontend.listener_ids.clear();
view.cache.expose_only_hits = None;
// The complete LB policy (keepalive, recycling, weights, retries, health,
// affinity and queues) governs connection selection, not cache identity.
// Sticky authentication checks and bypass still run before the cache lookup.
view.load_balancing = Default::default();
for member in &mut view.backends {
member.weight = 1;
@@ -196,8 +184,6 @@ fn cache_invalidation(previous: &config::Config, next: &config::Config) -> Cache
.filter(|(id, revision)| new.get(*id) != Some(*revision))
.map(|(id, _)| id.clone())
.collect();
// New scopes do not have previous cache objects, but include the set for
// completeness if an ID is ever reused within a single config transaction.
changed.extend(new.keys().filter(|id| !old.contains_key(*id)).cloned());
changed.sort();
changed.dedup();