Comment 5 for bug 507557

Revision history for this message
Robert Collins (lifeless) wrote : Re: [Bug 507557] Re: Overlapping autopacks can fail with NoSuchFile when obsoleting packs

On Mon, 2010-01-18 at 18:27 +0000, John A Meinel wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
>
> ...
>
> > Some possible solutions:
> > 1. If it's OK to have some revisions duplicated in different packs then we could:
> > (a) make obsolete_pack() ignore NoSuchFile and just assume someone else had already obsoleted the file, or
> > (b) be smarter about which packs we try to obsolete. We may be able to determine this in _diff_pack_names() by calculating the intersection of deleted_nodes and disk_nodes.
>
> It is ok. So we can just skip the removal. One other alternative...
> before we delete the files, I believe we check the 'obsolete_packs'
> directory for any files and delete them. I would recommend that if we
> have a file that is queued for obsoleting, but is present in
> obsolete_packs, then we should
>
> 1) remove it from the 'to-obsolete' queue
> 2) remove it from the 'to-delete' queue
>
> The reason we wait to delete is to make sure the os has time to actually
> sync changes to disk. Since we would have marked it obsolete
> 'right-now', we can presume that someone else also made that decision
> 'right now', and we should put off deleting the file until later.
>
> We should still handle NoSuchFile, but it should make the window of
> things we try to obsolete smaller.

I like your logic here.

-Rob