From: jmelvin@codeaurora.org
To: Junio C Hamano <gitster@pobox.com>
Cc: git@vger.kernel.org, nasserg@codeaurora.org,
mfick@codeaurora.org, peff@peff.net, sbeller@google.com
Subject: Re: [PATCH] repack: Add options to preserve and prune old pack files
Date: Fri, 10 Mar 2017 14:52:10 -0700 [thread overview]
Message-ID: <5b578a236338771fbb08007417b26438@codeaurora.org> (raw)
In-Reply-To: <xmqq4lz4968p.fsf@gitster.mtv.corp.google.com>
On 2017-03-07 13:33, Junio C Hamano wrote:
> James Melvin <jmelvin@codeaurora.org> writes:
>
...
>
> I am not sure if I understand your design. Your model looks to me
> like there are two modes of operation. #1 uses "--preserve-old" and
> sends old ones to purgatory instead of removing them and #2 uses
> "--prune-preserved" to remove all the ones in the purgatory
> immediately. A few things that come to my mind immediately:
>
> * When "--prune-preseved" is used, it removes both ancient ones and
> more recent ones indiscriminately. Would it make more sense to
> "expire" only the older ones while keeping the more recent ones?
>
> * It appears that the main reason you would want --prune-preserved
> in this design is after running with "--preserve-old" number of
> times, you want to remove really old ones that have accumulated,
> and I would imagine that at that point of time, you are only
> interested in repack, but the code structure tells me that this
> will force the users to first run a repack before pruning.
>
> I suspect that a design that is simpler to explain to the users may
> be to add a command line option "--preserve-pruned=<expiration>" and
> a matching configuration variable repack.preservePruned, which
> defaults to "immediate" (i.e. no preserving), and
>
> - When the value of preserve_pruned is not "immediate", use
> preserve_pack() instead of unlink();
>
> - At the end, find preserved packs that are older than the value in
> preserve_pruned and unlink() them.
>
> It also may make sense to add another command line option
> "--prune-preserved-packs-only" (without matching configuration
> variable) that _ONLY_ does the "find older preserved packs and
> unlink them" part, without doing any repack.
I like the idea of only having a single option to do both the preserving
and the pruning. It makes the operation more cycle based, which is more
closely tied to the use case this is intended for. Ie. Run repack while
preserving old pack files so that any open file handles to those pack
files will continue to work, while the next time repack is run it is
highly likely those will no longer be needed, so they can be cleaned up.
Obviously this depends on how frequent repack is run, but something an
Administrator can determine.
I'll push a patch that combines that functionality into a single option
to review.
-James
--
Qualcomm Innovation Center, Inc.
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora
Forum,
a Linux Foundation Collaborative Project
prev parent reply other threads:[~2017-03-10 21:52 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-03-07 16:40 [PATCH] repack: Add options to preserve and prune old pack files James Melvin
2017-03-07 20:33 ` Junio C Hamano
2017-03-09 17:50 ` jmelvin
2017-03-09 18:45 ` Martin Fick
2017-03-10 21:52 ` jmelvin [this message]
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=5b578a236338771fbb08007417b26438@codeaurora.org \
--to=jmelvin@codeaurora.org \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=mfick@codeaurora.org \
--cc=nasserg@codeaurora.org \
--cc=peff@peff.net \
--cc=sbeller@google.com \
/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).