Comment 4 for bug 507557

Revision history for this message
John A Meinel (jameinel) wrote : Re: [Bug 507557] Re: Overlapping autopacks can fail with NoSuchFile when obsoleting packs

-----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.

> 2. If it's not OK then we could somehow detect that revisions were being duplicated and back out the second autopack. Perhaps _save_pack_names() could fail if packs it was expecting to remove had already been removed from pack-names.
>

The repository is designed to scale to multiple concurrent writers. (We
only have one small pack-names file whose writes must be serialized,
rather than all pack files.) As such, the design has to be tolerant of
data being present multiple times. (If I push a branch with revs 1 and
2, and you push a branch with revs 1 and 3, 1 can easily get pushed 2
times.)

John
=:->

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (Cygwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAktUqBIACgkQJdeBCYSNAAOTewCfUxcAjafoKmqmuWQx2ErxJe7Q
ehAAni1G1JufpiwTwf0kXlnNoN72KMNx
=WQxY
-----END PGP SIGNATURE-----