Thread (6 messages) flat view 6 messages, 3 authors, 2016-06-15

Re: Keeping unreachable objects in a separate pack instead of loose?

From: Jeff King <hidden>
Date: 2016-06-15 22:54:03

On Tue, Jun 12, 2012 at 08:43:41PM +0200, Andreas Schwab wrote:
Jeff King [off-list ref] writes:
quoted
We could close it in both cases by tweaking the mtime of the file
containing the object when we decide not to write because the object
already exists.
Though there is always the window between the existence check and the
mtime update where pruning can hit you.
For the loose object case, you could do them both atomically by calling
utime() on the object, and considering the object to exist only if it
succeeds.

Doing it safely for packs would be harder, though; I think you'd
have to bump the mtime forward, do the search, and then bump it back.
You might err by causing a pack not to be pruned, but that is better
than the opposite.

Unfortunately it gets trickier with network transfers. If somebody is
pushing to your repository, you might tell them you have some set of
objects, then they prepare a pack based on that assumption (which might
take minutes or hours to transfer), and then finally at the end you find
that you actually need the objects in question. Of course, that race is
even harder to trigger, because we do not advertise unreachable objects.
So you would have to have a sequence where the objects are reachable,
the client connects and receives your ref advertisement, then the
objects become unreachable (e.g., due to a simultaneous non-ff push or
deletion), and you do a prune in that interval which removes the
objects.  Unlikely, but still possible.

-Peff
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help