From: Junio C Hamano <junkio@cox.net>
To: Sean <seanlkml@sympatico.ca>
Cc: Shawn Pearce <spearce@spearce.org>, Nicolas Pitre <nico@cam.org>,
Eran Tromer <git2eran@tromer.org>,
git@vger.kernel.org
Subject: Re: fetching packs and storing them as packs
Date: Thu, 26 Oct 2006 23:57:13 -0700 [thread overview]
Message-ID: <7viri6i6uu.fsf@assigned-by-dhcp.cox.net> (raw)
In-Reply-To: <BAYC1-PASMTP10C050A5FAA4C70AD57679AE040@CEZ.ICE> (seanlkml@sympatico.ca's message of "Thu, 26 Oct 2006 22:38:04 -0400")
Sean <seanlkml@sympatico.ca> writes:
> On Thu, 26 Oct 2006 21:42:29 -0400
> Shawn Pearce <spearce@spearce.org> wrote:
>
>> This is an issue for "central" repositories that people push into
>> and which might be getting repacked according to a cronjob.
>>
>> Unfortunately I don't have a solution. I tried to come up with
>> one but didn't. :-)
>
> What about creating a temporary ref before pushing, and then removing
> it only after the HEAD has been updated?
That won't work. If repack is faster than index-pack, repack
would fail to find necessary objects, barf, and would not remove
the existing or new pack, and then index-pack would eventually
succeed and when it does at least your repository is complete
even though it may still have redundant objects in packs.
So in that sense, it is not a disaster, so it might be a good
enough solution.
I'd almost say "heavy repository-wide operations like 'repack -a
-d' and 'prune' should operate under a single repository lock",
but historically we've avoided locks and instead tried to do
things optimistically and used compare-and-swap to detect
conflicts, so maybe that avenue might be worth pursuing.
How about (I'm thinking aloud and I'm sure there will be
holes -- I won't think about prune for now)...
* "repack -a -d":
(1) initially run show-ref (or "ls-remote .") and store the
result in .git/$ref_pack_lock_file;
(2) enumerate existing packs;
(3) do the usual "rev-list --all | pack-objects" thing; this
may end up including more objects than what are reachable
from the result of (1) if somebody else updates refs in the
meantime;
(4) enumerate existing packs; if there is difference from (2)
other than what (3) created, that means somebody else added
a pack in the meantime; stop and do not do the "-d" part;
(5) run "ls-remote ." again and compare it with what it got in
(1); if different, somebody else updated a ref in the
meantime; stop and do not do the "-d" part;
(6) do the "-d" part as usual by removing packs we saw in (2)
but do not remove the pack we created in (3);
(7) remove .git/$ref_pack_lock_file.
* "fetch --thin" and "index-pack --stdin":
(1) check the .git/$ref_pack_lock_file, and refuse to operate
if there is such (this is not strictly needed for
correctness but only to give an early exit);
(2) create a new pack under a temporary name, and when
complete, make the pack/index pair .pack and .idx;
(3) update the refs.
next prev parent reply other threads:[~2006-10-27 6:57 UTC|newest]
Thread overview: 51+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-10-26 3:44 fetching packs and storing them as packs Nicolas Pitre
2006-10-26 14:45 ` Eran Tromer
[not found] ` <Pine.LNX.4.64.0610261105200.12418@xanadu.home>
2006-10-26 22:09 ` Eran Tromer
2006-10-27 0:50 ` Nicolas Pitre
2006-10-27 1:42 ` Shawn Pearce
2006-10-27 2:38 ` Sean
2006-10-27 6:57 ` Junio C Hamano [this message]
2006-10-27 17:23 ` Nicolas Pitre
2006-10-27 2:41 ` Nicolas Pitre
2006-10-27 2:42 ` Eran Tromer
2006-10-27 3:00 ` Shawn Pearce
2006-10-27 3:13 ` Sean
2006-10-27 3:20 ` Jakub Narebski
2006-10-27 3:27 ` Sean
2006-10-27 4:03 ` Eran Tromer
2006-10-27 4:42 ` Shawn Pearce
2006-10-27 7:42 ` Alex Riesen
2006-10-27 7:52 ` Shawn Pearce
2006-10-27 8:08 ` Alex Riesen
2006-10-27 8:13 ` Shawn Pearce
2006-10-27 14:27 ` Nicolas Pitre
2006-10-27 14:38 ` Petr Baudis
2006-10-27 14:48 ` J. Bruce Fields
2006-10-27 15:03 ` Petr Baudis
2006-10-27 16:04 ` J. Bruce Fields
2006-10-27 16:05 ` J. Bruce Fields
2006-10-27 18:56 ` Junio C Hamano
2006-10-27 20:22 ` Linus Torvalds
2006-10-27 21:53 ` Junio C Hamano
2006-10-28 3:42 ` Shawn Pearce
2006-10-28 4:09 ` Junio C Hamano
2006-10-28 4:18 ` Linus Torvalds
2006-10-28 5:42 ` Junio C Hamano
2006-10-28 7:21 ` Shawn Pearce
2006-10-28 8:40 ` Shawn Pearce
2006-10-28 19:15 ` Junio C Hamano
2006-10-29 3:50 ` Shawn Pearce
2006-10-29 4:29 ` Junio C Hamano
2006-10-29 4:38 ` Shawn Pearce
2006-10-29 5:16 ` Junio C Hamano
2006-10-29 5:21 ` Shawn Pearce
2006-10-28 17:59 ` Linus Torvalds
2006-10-28 18:34 ` Junio C Hamano
2006-10-28 22:31 ` Eran Tromer
2006-10-29 3:38 ` Shawn Pearce
2006-10-29 3:48 ` Jakub Narebski
2006-10-29 3:52 ` Shawn Pearce
2006-10-29 7:47 ` [PATCH] send-pack --keep: do not explode into loose objects on the receiving end Junio C Hamano
2006-10-29 7:56 ` Shawn Pearce
2006-10-29 8:05 ` Junio C Hamano
2006-10-30 1:44 ` Nicolas Pitre
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=7viri6i6uu.fsf@assigned-by-dhcp.cox.net \
--to=junkio@cox.net \
--cc=git2eran@tromer.org \
--cc=git@vger.kernel.org \
--cc=nico@cam.org \
--cc=seanlkml@sympatico.ca \
--cc=spearce@spearce.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.