git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Boomman <boomman37@gmail.com>
Cc: Jeff King <peff@peff.net>,  git@vger.kernel.org
Subject: Re: git gc does not clean tmp_pack* files
Date: Thu, 19 Dec 2024 03:17:01 -0800	[thread overview]
Message-ID: <xmqqmsgrncr6.fsf@gitster.g> (raw)
In-Reply-To: <CADMKT28cZcdW8UJ59vZHoMa0WEbyAccx4A10-jk3MiBkhZLxEg@mail.gmail.com> (Boomman's message of "Thu, 19 Dec 2024 00:26:15 -0800")

Boomman <boomman37@gmail.com> writes:

> Yes, if the behavior in case of running out of disk space is to just
> leave the malformed file there, it stands to reason that cleaning up
> those malformed files should be the first operation to do for gc.

It is misleading to call them malformed, isn't it?  When a Git
process creates a packfile (or loose object file for that matter),
they are written under these tmp_* names.  When the processes die
without finalizing these (either removing or renaming into their
final names), they are left behind, and it would be better if we can
remove it _before_ another process wants to consume more disk space.

But the issue is how you tell which one of these "malformed" files
are still being written and will be finalized, and which ones are
leftover ones.  You want to remove the latter without molesting the
former.  And you want to do so in a portable way, possibly even
across the network file systems.

I guess, as Peff alluded to, we could do at the beginning of "gc" to
prune only these "possibly in progress, possibly leftover" files
that are too old, repack the clearly "finalized" ones, and then
prune again, this time including the "finalized" ones that are no
longer in use, which would help the creation of new packfiles from
being blocked by these leftover files that are hoarding disk quota.

  reply	other threads:[~2024-12-19 11:17 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-12-19  2:19 git gc does not clean tmp_pack* files Boomman
2024-12-19  5:42 ` Jeff King
2024-12-19  8:26   ` Boomman
2024-12-19 11:17     ` Junio C Hamano [this message]
2024-12-20  9:05       ` Jeff King
2024-12-21  1:17         ` Boomman
2024-12-28 19:44           ` Jeff King
2024-12-28 20:13             ` Boomman

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=xmqqmsgrncr6.fsf@gitster.g \
    --to=gitster@pobox.com \
    --cc=boomman37@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=peff@peff.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).