Browse Source

Fix is_expired to use <= for SuperBlockSize check matching Go

Go checks contentSize <= SuperBlockSize to detect empty volumes (no
needles). Rust used < which would incorrectly allow a volume with
exactly SuperBlockSize bytes (header only, no data) to proceed to
the TTL expiry check and potentially be marked as expired.
rust-volume-server
Chris Lu 4 days ago
parent
commit
1baecda334
  1. 2
      seaweed-volume/src/storage/volume.rs

2
seaweed-volume/src/storage/volume.rs

@ -1645,7 +1645,7 @@ impl Volume {
if volume_size_limit == 0 {
return false;
}
if volume_size < SUPER_BLOCK_SIZE as u64 {
if volume_size <= SUPER_BLOCK_SIZE as u64 {
return false;
}
let ttl_minutes = self.super_block.ttl.minutes();

Loading…
Cancel
Save