Discard archived session checkpoints

This commit is contained in:
Georg Bauer
2026-07-28 19:20:10 +02:00
parent 74c5948955
commit eaa2fcfe42
5 changed files with 154 additions and 20 deletions

View File

@@ -962,6 +962,15 @@ impl Generator {
matches: impl Fn([u8; 32]) -> bool,
) -> Result<CheckpointSelection, String> {
let resident_hit = self.activate_resident(checkpoint.to_owned())?;
if !checkpoint.is_file() {
self.executor.reset()?;
self.checkpoint = None;
self.metrics.kv_lookup(KvLookup::Miss);
return Ok(CheckpointSelection {
found: false,
incompatible: false,
});
}
if resident_hit && matches(self.executor.checkpoint_tag()) {
self.checkpoint = Some(checkpoint.to_owned());
self.metrics.kv_lookup(KvLookup::MemoryHit);
@@ -971,15 +980,6 @@ impl Generator {
});
}
if self.checkpoint.as_deref() == Some(checkpoint) {
if !checkpoint.is_file() {
self.executor.reset()?;
self.checkpoint = None;
self.metrics.kv_lookup(KvLookup::Miss);
return Ok(CheckpointSelection {
found: false,
incompatible: false,
});
}
let found = matches(self.executor.checkpoint_tag());
self.metrics.kv_lookup(if found {
KvLookup::MemoryHit