--Brandon
Exactly.
There are some situations I can think of that might cause minor
(recoverable) problems. For example, if the system crashes before all
the files are synced, we might end up with pack #7 being slightly
corrupt but pack #8 being valid. Then deleting pack #7 would result
in missing objects that you might not immediately discover.
Also, if a .pack file is invalid, bup might not notice it and might
keep using the .idx anyway, which would result in certain missing
objects not being backed up as they should be. I haven't tested that
very carefully.
Someday, we should improve 'bup fsck' to be able to check stuff like
that and throw away bad or mismatched packs, just to be safe.
However, this situation is pretty contrived and should be very rare,
even in the case of a crash.
Maybe we should fsync() more frequently, like after writing a .pack or
.idx file. I really hate fsync() though, since its performance is so
terrible on ext3. (fsync() on any file ends up being basically the
same as a full sync() of the entire filesystem. Barf.)
If you're worried about another form of corruption - ie. silent loss
of data in .pack files due to hard drive sector errors - you should
consider using 'bup fsck -g'.
Have fun,
Avery
Just watch out for one thing: the git commit that your branch points
at. It may be that the final commit of a particular backup is valid
right now, but if you delete old (valid) packs, it might become
invalid and you might need to re-point the branch at a commit that
still exists.
So basically:
cd ~/.bup
git rev-list name-of-my-branch >my-commits
...delete some packs...
git log name-of-my-branch
# if it fails, try each of the branches in my-commits in turn.
# let's call the first one that matches $TOPCOMMIT
git branch -d name-of-my-branch
git branch name-of-my-branch $TOPCOMMIT
Then you should be okay.
So basically, deleting the packs is fine, but you want to be careful
not to lose track of the part of history you *didn't* delete.
We could probably put more work into bup fsck, autorecovery, and so
on. But since it's generally *possible* (although a bit of work like
the above) to recover from problems, it hasn't been a big deal.
Have fun,
Avery