git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: Simultaneous gc and repack

From
MFMartin Fick <mfick@codeaurora.org>
Date
Apr 13, 2017, 18:08 UTC
Message-ID
<10832632.7AIzXehjUi@mfick1-lnx>
In-Reply-To
<CA+P7+xo4mwA8DMeObq_T9=P9m7tG1d6afDS_Md56_EnhuXLVgw@mail.gmail.com>
On Thursday, April 13, 2017 11:03:14 AM Jacob Keller wrote:
> On Thu, Apr 13, 2017 at 10:31 AM, David Turner 
<novalis@novalis.org> wrote:
Show 20 quoted lines
> > Git gc locks the repository (using a gc.pid file) so
> > that other gcs don't run concurrently. But git repack
> > doesn't respect this lock, so it's possible to have a
> > repack running at the same time as a gc.  This makes
> > the gc sad when its packs are deleted out from under it
> > with: "fatal: ./objects/pack/pack-$sha.pack cannot be
> > accessed".  Then it dies, leaving a large temp file
> > hanging around.
> > 
> > Does the following seem reasonable?
> > 
> > 1. Make git repack, by default, check for a gc.pid file
> > (using the same logic as git gc itself does).
> > 2. Provide a --force option to git repack to ignore said
> > check. 3. Make git gc provide that --force option when
> > it calls repack under its own lock.
> 
> What about just making the code that calls repack today
> just call gc instead? I guess it's more work if you don't
> strictly need it but..?

There are many scanerios where this does not achieve the same thing. On the obvious side, gc does more than repacking, but on the other side, repacking has many switches that are not available via gc.

Would it make more sense to move the lock to repack instead of to gc?

-Martin
-- 
The Qualcomm Innovation Center, Inc. is a member of Code 
Aurora Forum, hosted by The Linux Foundation
Previous: Jacob KellerNext: David Turner
Message 3 of 7 in “Simultaneous gc and repack”
  1. David TurnerApr 13, 2017
  2. Jacob KellerApr 13, 2017
  3. Martin FickApr 13, 2017
  4. David TurnerApr 13, 2017
  5. Jacob KellerApr 13, 2017
  6. Martin FickApr 13, 2017
  7. David TurnerApr 13, 2017

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.