From fd9c64eddda74b2467ad8fe7caec0ca0afe4e14a Mon Sep 17 00:00:00 2001 From: Chris Lu Date: Tue, 17 Mar 2026 18:09:05 -0700 Subject: [PATCH] Skip tombstone entries in walk_ecx_stats total_size matching Go's Raw() --- seaweed-volume/src/storage/erasure_coding/ec_volume.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/seaweed-volume/src/storage/erasure_coding/ec_volume.rs b/seaweed-volume/src/storage/erasure_coding/ec_volume.rs index c8a9bb60e..fa94e899e 100644 --- a/seaweed-volume/src/storage/erasure_coding/ec_volume.rs +++ b/seaweed-volume/src/storage/erasure_coding/ec_volume.rs @@ -448,8 +448,10 @@ impl EcVolume { ecx_file.read_exact_at(&mut entry_buf, file_offset)?; } let (_key, _offset, size) = idx_entry_from_bytes(&entry_buf); - // Raw size includes the sign bit; match Go's size.Raw() which is uint32 - total_size += size.0.unsigned_abs() as u64; + // Match Go's Size.Raw(): tombstone (-1) returns 0, other negatives return abs + if !size.is_tombstone() { + total_size += size.0.unsigned_abs() as u64; + } if size.is_deleted() { files_deleted += 1; } else {