Discard archived session checkpoints
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user