restic: Prune stats calculation bug

Output of restic version

restic_v0.11.0-g5f3b802e

How did you run restic exactly?

restic_v0.11.0-g5f3b802e prune > prune.log

Actual behavior

to repack:       308801 blobs / 178.132 GiB
this removes     308801 blobs / 178.130 GiB
to delete:       327405 blobs / 197.824 GiB
total prune:     636206 blobs / 375.955 GiB
remaining:      1163369 blobs / 748.739 GiB
unused size after prune: 16777215.894 TiB (100.00% of remaining size)

Note the 16777215.894 TiB.

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Comments: 16 (14 by maintainers)

Most upvoted comments

@dimejo if you do, please run prune with -v -v, so we can get more stats. using --dry-run should be sufficient to get the stats.

@dimejo Thanks for reporting this bug! If you can manage to reproduce it, can you please also increase the verbosity (-v)? Also you can use --dry-run which gives the output (and should also show this bug) without modifying the repository…

I just tested the repo from cmd/restic/testdata/repo-duplicates.tar.gz and there the same bug in the statistics occurs:

to repack:            2 blobs / 220 B
this removes          2 blobs / 148 B
to delete:            4 blobs / 1.726 KiB
total prune:          6 blobs / 1.870 KiB
remaining:            4 blobs / 1.718 KiB
unused size after prune: 16777216.000 TiB (100.00% of remaining size)

(note that we also have the same “strange” effect that prune reports that all blobs that are reported to be repacked are also reported to be removed by the repacking. This is why I assume that duplicates are also present in the repo of @dimejo.)

Apologies, Yes I did confuse that release version with a much older release.

Anyway, the bug you reported looks very similar to the one that I reported two years ago. With luck the root cause will be the same, and the fix will be easy. (I am not a restic developer, just a user who monitors the bug reports).

Are you joking or did you confuse 0.11.0 with 0.1.0? Actually the version used is 2 days old and from beta.restic.net.

You are on a very old version of restic. I suggest you update.

Also, I think that is a dupe of #1954 that I reported 2 years ago.