fix: Exclude reference.bin from bucket stats calculations

reference.bin files are internal implementation details used for delta
compression. Their size was being incorrectly counted in both total_size
and compressed_size, resulting in 0% savings contribution.

Since delta file metadata already contains the original file_size that
the delta represents, including reference.bin would double-count storage.

This fix skips reference.bin files during stats calculation, consistent
with how they're filtered in other parts of the codebase (aws_compat.py,
sync.py, client.py).

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
Simone Scarduzio
2025-10-09 22:20:32 +02:00
parent fb2877bfd3
commit 5e3b76791e

View File

@@ -141,6 +141,11 @@ def get_bucket_stats(
direct_count = 0
for obj in all_objects:
# Skip reference.bin files - they are internal implementation details
# and their size is already accounted for in delta metadata
if obj.key.endswith("/reference.bin") or obj.key == "reference.bin":
continue
compressed_size += obj.size
if obj.is_delta: