diff --git a/crates/ml/src/feature_cache.rs b/crates/ml/src/feature_cache.rs index fd62592ec..cdee0b517 100644 --- a/crates/ml/src/feature_cache.rs +++ b/crates/ml/src/feature_cache.rs @@ -7,7 +7,6 @@ use anyhow::{Context, Result}; use sha2::{Digest, Sha256}; use std::path::{Path, PathBuf}; -use std::time::SystemTime; /// Calculate a cache key for a DBN data directory. /// @@ -52,7 +51,9 @@ pub fn calculate_dbn_cache_key_full( } for path in &files { - // Hash filename (not full path) + size + mtime + // Hash filename (not full path) + size. + // NOT mtime: PVC remounts and node reboots change file timestamps + // without changing data, causing cache misses on every new pod. if let Some(name) = path.file_name() { hasher.update(name.to_string_lossy().as_bytes()); } @@ -60,13 +61,6 @@ pub fn calculate_dbn_cache_key_full( .metadata() .with_context(|| format!("Failed to stat {:?}", path))?; hasher.update(&meta.len().to_le_bytes()); - let mtime = meta - .modified() - .context("mtime unavailable")? - .duration_since(SystemTime::UNIX_EPOCH) - .context("mtime before epoch")? - .as_secs(); - hasher.update(&mtime.to_le_bytes()); } Ok(format!("{:x}", hasher.finalize()))