Rob Browning <
r...@defaultvalue.org> writes:
> Greg Troxel <
g...@lexort.com> writes:
>
>> Rob Browning <
r...@defaultvalue.org> writes:
>
>>> I believe you can regnerate:
>>>
>>> - the midx via "bup midx",
>>
>> would this happen automatically if they were needed? As I understand
>> it, they are merely an efficient combined representation of the set of
>> idx files.
>
> Sounds like it:
>
> Note: you should no longer need to run this command by hand. It gets
> run automatically by bup-save(1) and similar commands.
Related, it's not clear to me if the latest midx is sufficient, and why
the earlier ones are kept around.
>>> - the bloom filter via "bup bloom", and
>>
>> Does/should bup fsck check that, and/or regen if missing?
>
> I doubt fsck does, but I suspect bup itself (or the relevant commands
> that need a bloom filter) will.
I would argue that there should be a specification for how the repo
ought to be, and that all commands should, when not having an error
exit, leave it that way, and that fsck should verify the invariant and
to the extent sane repair it, more or less how fsck on a filesystem
does.
>>> - the .idx files via:
>>> $ (set -e; for f in objects/pack/*.pack; do git index-pack "$f"; done)
>>
>> Does/should bup fsck check that, and/or regen if missing?
>
> I suspect not since by default fsck runs verify-pack to try to make sure
> that the packs are OK -- in part according to the .idx files.
>
> As it stands now, fsck can verify the pack files against their .idx
> files, or generate par2 data, or attempt repairs via par2 data.
So it seems like fsck needs a "ensure idx files exist and perhasp check
them" step.
> Generally speaking, I suspect missing .idx files would normally be
> extremely suspicious since they're effectively immutable per-pack
> summaries. If they're missing, I'd guess that either someone's been
> messing around, or something's gone terribly wrong (even though git can
> regenerate them).
True. But the point of fsck is to detect wrong things and fix them; in
a system that has not encountered storage errors and does not have code
errors it should be pointeless to run.