From: "Shawn O. Pearce" <spearce@spearce.org>
To: Junio C Hamano <junkio@cox.net>
Cc: Matthias Lederhofer <matled@gmx.net>, git@vger.kernel.org
Subject: Re: [RFC] prune: --expire=seconds
Date: Thu, 18 Jan 2007 22:44:04 -0500 [thread overview]
Message-ID: <20070119034404.GA17521@spearce.org> (raw)
In-Reply-To: <7vy7o0klt1.fsf@assigned-by-dhcp.cox.net>
Junio C Hamano <junkio@cox.net> wrote:
> Matthias Lederhofer <matled@gmx.net> writes:
>
> > This option specifies the minimum age of an object before it
> > may be removed by prune. The default value is 2 hours and
> > may be changed using gc.pruneexpire.
>
> I am not sure if this is needed, as Shawn explained earlier
> rounds of loose-objects safety work.
I think we need this fix. We still have a race condition between
the loose object creation and the ref update.
We've closed this hole completely in the large push case (objects
>=receive.unpackLimit) and 'fetch -k' case by creating .keep files
before the .pack file, updating refs, then deleting the .keep file;
and by making sure git-repack leaves packs with .keeps alone. So
we cannot lose an object here.
But update-index/add/merge-recursive/write-tree/commit-tree, etc.
as well as small pushes (objects <receive.unpackLimit) and fetch
without -k option still have a race condition. The objects will
be created/unpacked into the loose objects directory with nothing
referencing them, and a prune which gets to run just before before
the ref update becomes visible would probably whack those objects.
Given that 'git gc' is the encouraged way to maintain a repository,
and that 'repack -a -d' is safe, and prune-packed is equally safe,
I think we should try to make prune safe too. Matthias' patch
does this by giving the ref update process a fairly large window
to perform its action within.
> If this is something we would want, it might make sense if we
> allowed "prune --expire='1.day'" syntax ;-).
Yes, I agree.
Matthias you can take a look at builtin-reflog.c's argument handling
for an example. I think you just need to use approxidate() in both
your config function and in your command line argument handling.
Then the default becomes '2.hours.ago' instead of just "2" (at
least from a documentation perspective).
Though the more I think about this perhaps the default should be
'1.day'. 24 hours is a hellva large window for any current ref
update to complete in, even if the ref update was some massive rsync
which is doing a such a large volume of data on a small bandwidth
link that it takes 20 hours to complete. Besides, users could
always force it to be much lower with the command line option if
they really need to prune _right_now_.
--
Shawn.
next prev parent reply other threads:[~2007-01-19 3:44 UTC|newest]
Thread overview: 30+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-01-18 17:18 [PATCH] prune-packed: new option --min-age=N Matthias Lederhofer
2007-01-18 17:24 ` Shawn O. Pearce
2007-01-18 17:42 ` Matthias Lederhofer
2007-01-18 17:51 ` Shawn O. Pearce
2007-01-18 22:29 ` [RFC] prune: --expire=seconds Matthias Lederhofer
2007-01-18 22:32 ` Junio C Hamano
2007-01-19 3:44 ` Shawn O. Pearce [this message]
2007-01-19 10:49 ` [PATCH] prune: --expire=time Matthias Lederhofer
2007-01-19 15:41 ` Nicolas Pitre
2007-01-19 19:18 ` Junio C Hamano
2007-01-20 11:18 ` Matthias Lederhofer
2007-01-21 6:55 ` Junio C Hamano
2007-01-21 7:53 ` Shawn O. Pearce
2007-01-21 10:37 ` Matthias Lederhofer
2007-01-21 11:17 ` Junio C Hamano
2007-01-21 22:01 ` Jeff King
2007-01-22 1:38 ` Steven Grimm
2007-01-22 1:52 ` Jeff King
2007-01-22 2:06 ` Junio C Hamano
2007-01-22 2:23 ` Linus Torvalds
2007-01-22 2:40 ` Junio C Hamano
2007-01-22 2:58 ` Linus Torvalds
2007-01-22 5:17 ` Junio C Hamano
2007-01-22 6:26 ` Linus Torvalds
2007-01-22 6:57 ` Shawn O. Pearce
2007-01-22 7:12 ` Junio C Hamano
2007-01-22 9:32 ` Jakub Narebski
2007-01-22 3:26 ` [PATCH] v1.5.0.txt: update description of git-gc Jeff King
2007-01-22 2:03 ` [PATCH] prune: --expire=time Junio C Hamano
2007-01-20 12:06 ` Simon 'corecode' Schubert
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=20070119034404.GA17521@spearce.org \
--to=spearce@spearce.org \
--cc=git@vger.kernel.org \
--cc=junkio@cox.net \
--cc=matled@gmx.net \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).