Restic stats difference between 0.13.1 vs 0.14.0

Hello,

I upgraded one of my remote ssh repos to repo version 2 yesterday using the instructions from the homepage. Everything went smoth and a subsequent restic check run did not reveal any problems.

What I noticed though is that the restic stat produced vastly different results before and after the migration. Here is the ouput of the two restic stat runs:

Before migration using restic 0.13.1

repository db047304 opened successfully, password is correct
scanning...
Stats in restore-size mode:
Snapshots processed:   31
   Total File Count:   511711
         Total Size:   29.894 GiB

After migration using restic 0.14.0

repository db047304 opened (repository version 2) successfully, password is correct
scanning...
Stats in restore-size mode:
Snapshots processed:   31
   Total File Count:   511711
         Total Size:   376.665 GiB

The total size in the second restic stat ouput differs substantially from the former run by more than an order of magnitude.

Should I be worried about this discrepancy? Or could this just be a bug in the way either of the commands calculates the total?

Interstingly I could not reproduce this with a second local repo on a usb drive that is directly attached. The total size output of restic stats was exactly the same before and after the migration.

Cheers

This looks to me like it might be due to a bug that was fixed in Fix restore size calculation for multiple snapshots by MichaelEischer · Pull Request #3740 · restic/restic · GitHub

So the second restic stat run (the one using restic v0.14.0) produces the correct “Total Size” figure.

Thank you @shd2h for your reply. I found the same bug you mentioned in the meantime by browsing GitHub issues. It would certainly explain my observation.

If restic check returns with a positive result, I should be on the safe side with my backup repo, is that correct?

That depends on what exactly you wanted to check. Quoting the docs, there are two types of checks restic can run on the repository:

  • Structural consistency and integrity, e.g. snapshots, trees and pack files (default)
  • Integrity of the actual data that you backed up (enabled with flags, see below)

If you want to run the second check, you’ll need to run restic check --read-data. This isn’t the default behaviour, because it’s slower and it involves retrieving every pack file from the repository.
Full details here: Working with repositories — restic 0.14.0 documentation

Speaking specifically to your situation, assuming you just wanted to make sure that the conversion completed successfully, I would say that a normal check passing is a good indication that all is well. For maximum thoroughness that all of your data is intact though, using --read-data would seem to make sense.

1 Like