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

Re: Race condition between repack and loose-objects maintenance task

From
Taylor Blau <me@ttaylorr.com>
Date
Jun 29, 2022, 17:10 UTC
Message-ID
<YryHoXhmkvkl6X2j@nand.local>
In-Reply-To
<YryF+vkosJOXf+mQ@nand.local>
On Wed, Jun 29, 2022 at 01:03:54PM -0400, Taylor Blau wrote:
> I see that Stolee is already on the CC list, so perhaps he could chime
> in on the above.

I haven't looked at the maintenance code too closely as of yet, but I have a plausible explanation for why maintenance is removing loose *unreachable* objects.

Ordinarily the loose-objects task alone will not remove any loose objects which don't already appear in a pack. That's because we first try to run prune-packed, and then the equivalent of `git repack -d` to consolidate loose objects together into a single pack.

But, we only do that for the first 50,000 loose objects. Anything else gets left around and then is likely removed by the `git gc` task which is run separately, and after the loose-objects task.

Using cruft packs won't change the race fundamentally, but storing the unreachable objects in a cruft pack will mean that you can keep more objects around stored together in a single pack. In other words, making it safe to increase the grace period beyond what you would ordinarily be able to do with the classic pruning mechanism.

Thanks, Taylor

Previous: Taylor BlauNext: Gregory Szorc
Message 3 of 16 in “Race condition between repack and loose-objects maintenance task”
  1. Gregory SzorcJun 29, 2022
  2. Taylor BlauJun 29, 2022
  3. Taylor BlauJun 29, 2022
  4. Gregory SzorcJun 29, 2022
  5. Taylor BlauJun 29, 2022
  6. Gregory SzorcJun 30, 2022
  7. Taylor BlauJun 30, 2022
  8. Taylor BlauJun 30, 2022
  9. Junio C HamanoJun 30, 2022
  10. Gregory SzorcJul 5, 2022
  11. Ævar Arnfjörð BjarmasonJul 6, 2022
  12. Gregory SzorcJul 20, 2022
  13. Ævar Arnfjörð BjarmasonJul 20, 2022
  14. Gregory SzorcJul 26, 2022
  15. Ævar Arnfjörð BjarmasonJul 26, 2022
  16. Gregory SzorcJul 20, 2022

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.