From 779bfbba99a7535f349c76d76bc131dba80eaf84 Mon Sep 17 00:00:00 2001 From: Chris Lu Date: Tue, 17 Mar 2026 14:39:44 -0700 Subject: [PATCH] Match Go TTL expiry: remove append_at_ns > 0 guard Go computes TTL expiry from AppendAtNs without guarding against zero. When append_at_ns is 0, the expiry is epoch + TTL which is in the past, correctly returning NotFound. Rust's extra guard skipped the check, incorrectly returning success for such needles. --- seaweed-volume/src/storage/volume.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/seaweed-volume/src/storage/volume.rs b/seaweed-volume/src/storage/volume.rs index 94d42c853..aeaffdd7b 100644 --- a/seaweed-volume/src/storage/volume.rs +++ b/seaweed-volume/src/storage/volume.rs @@ -1032,7 +1032,7 @@ impl Volume { if n.has_ttl() { if let Some(ref ttl) = n.ttl { let ttl_minutes = ttl.minutes(); - if ttl_minutes > 0 && n.has_last_modified_date() && n.append_at_ns > 0 { + if ttl_minutes > 0 && n.has_last_modified_date() { let expire_at_ns = n.append_at_ns + (ttl_minutes as u64) * 60 * 1_000_000_000; let now_ns = SystemTime::now() .duration_since(UNIX_EPOCH) @@ -1291,7 +1291,7 @@ impl Volume { if n.has_ttl() { if let Some(ref ttl) = n.ttl { let ttl_minutes = ttl.minutes(); - if ttl_minutes > 0 && n.has_last_modified_date() && n.append_at_ns > 0 { + if ttl_minutes > 0 && n.has_last_modified_date() { let expire_at_ns = n.append_at_ns + (ttl_minutes as u64) * 60 * 1_000_000_000; let now_ns = SystemTime::now() .duration_since(UNIX_EPOCH)