-
-
Notifications
You must be signed in to change notification settings - Fork 791
Description
We need to 1) check for overflow and 2) raise the limit.
I think this limit is a bit tight, and we need to add a quick check for this overflow :). (Note index implementation details may interfere a little. I think you're not allowed to use the bit pattern 0xffffffff or oxfffffffe anyway & there is no check there either).
To fix it I think we only need to change the index format. In theory the index can be rebuilt if your attic doesn't recognize it, so in some sense we'd already have backwards and forwards compatibility. (I know attic has some repair code, though I haven't tried just deleting the index ad seeing what happens yet :).
@ThomasWaldmann pointed out that my test results indicate very large chunks (8M, the maximum size?) for the zero data. (Which also sounds suspicious to me, but hey :). That should mitigate the problem somewhat. OTOH I believe the chunker is keyed when encryption is used, so the size should be variable.
To overflow refcount in the chunk index, you need 2GiB * ~64KiB (of zeros or other consistent pattern, again assuming default chunk size).
There's not a big margin there, and we need to make sure we have an overflow check. You can include a 500G sparse VM image (mostly zero) in the backup. If it never changes then "incremental" backups are plenty fast, but you overflow after 256 daily backups.
See also: jborg/attic#315