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

Re: [PATCH v2] packfile: freshen the mtime of packfile by configuration

From
Taylor Blau <me@ttaylorr.com>
Date
Jul 14, 2021, 02:52 UTC
Message-ID
<YO5RZ0Wix/K5q53Z@nand.local>
In-Reply-To
<87wnpt1wwc.fsf@evledraar.gmail.com>
On Wed, Jul 14, 2021 at 03:39:18AM +0200, Ævar Arnfjörð Bjarmason wrote:
Show 16 quoted lines
> Hrm, per my v1 feedback (and I'm not sure if my suggestion is even good
> here, there's others more familiar with this area than I am), I was
> thinking of something like a *.bump file written via:
>
>     core.packUseBumpFiles=bool
>
> Or something like that, anyway, the edge case in allowing the user to
> pick arbitrary suffixes is that we'd get in-the-wild user arbitrary
> configuration squatting on a relatively sensitive part of the object
> store.
>
> E.g. we recently added *.rev files to go with
> *.{pack,idx,bitmap,keep,promisor} (and I'm probably forgetting some
> suffix). What if before that a user had set:
>
>     core.packMtimeSuffix=rev

I think making the suffix configurable is probably a mistake. It seems like an unnecessary detail to expose, but it also forces us to think about cases like these where the configured suffix is already used for some other purpose.

I don't think that a new ".bump" file is a bad idea, but it does seem like we have a lot of files that represent a relatively little amount of the state that a pack can be in. The ".promisor" and ".keep" files both come to mind here. Some thoughts in this direction:

  - Combining *all* of the pack-related files (including the index,
    reverse-index, bitmap, and so on) into a single "pack-meta" file
    seems like a mistake for caching reasons.
  - But a meta file that contains just the small state (like promisor
    information and whether or not the pack is "kept") seems like it
    could be OK. On the other hand, being able to tweak the kept state
    by touching or deleting a file is convenient (and having to rewrite
    a meta file containing other information is much less so).

But a ".bump" file does seem like an awkward way to not rely on the mtime of the pack itself. And I do think it runs into compatibility issues like Ævar mentioned. Any version of Git that includes a hypothetical .bump file (or something like it) needs to also update the pack's mtime, too, so that old versions of Git can understand it. (Of course, that could be configurable, but that seems far too obscure to me).

Stepping back, I'm not sure I understand why freshening a pack is so slow for you. freshen_file() just calls utime(2), and any sync back to the disk shouldn't need to update the pack itself, just a couple of fields in its inode. Maybe you could help explain further.

In any case, I couldn't find a spot in your patch that updates the packed_git's 'mtime' field, which is used to (a) sort packs in the linked list of packs, and (b) for determining the least-recently used pack if it has individual windows mmapped.

Thanks, Taylor

Previous: Ævar Arnfjörð BjarmasonNext: Sun Chao
Message 6 of 34 in “packfile: enhance the mtime of packfile by idx file”
  1. packfile: enhance the mtime of packfile by idx fileSun Chao via GitGitGadget, Jul 10, 2021
  2. Ævar Arnfjörð BjarmasonJul 11, 2021
  3. Sun ChaoJul 12, 2021
  4. packfile: freshen the mtime of packfile by configurationSun Chao via GitGitGadget, Jul 14, 2021
  5. Ævar Arnfjörð BjarmasonJul 14, 2021
  6. Taylor BlauJul 14, 2021
  7. Sun ChaoJul 14, 2021
  8. Taylor BlauJul 14, 2021
  9. Ævar Arnfjörð BjarmasonJul 14, 2021
  10. Martin FickJul 14, 2021
  11. Ævar Arnfjörð BjarmasonJul 14, 2021
  12. Martin FickJul 14, 2021
  13. Ævar Arnfjörð BjarmasonJul 20, 2021
  14. Son Luong NgocJul 15, 2021
  15. Ævar Arnfjörð BjarmasonJul 20, 2021
  16. Taylor BlauJul 14, 2021
  17. Ævar Arnfjörð BjarmasonJul 14, 2021
  18. Taylor BlauJul 14, 2021
  19. Junio C HamanoJul 14, 2021
  20. Sun ChaoJul 15, 2021
  21. Taylor BlauJul 15, 2021
  22. Sun ChaoJul 15, 2021
  23. Sun ChaoJul 14, 2021
  24. packfile: freshen the mtime of packfile by configurationSun Chao via GitGitGadget, Jul 19, 2021
  25. Taylor BlauJul 19, 2021
  26. Junio C HamanoJul 20, 2021
  27. Sun ChaoJul 20, 2021
  28. Ævar Arnfjörð BjarmasonJul 20, 2021
  29. Sun ChaoJul 20, 2021
  30. Sun ChaoJul 20, 2021
  31. Taylor BlauJul 20, 2021
  32. 0/2 packfile: freshen the mtime of packfile by configurationSun Chao via GitGitGadget, Aug 15, 2021
  33. 1/2 packfile: rename `derive_filename()` to `derive_pack_filename()`Sun Chao via GitGitGadget, Aug 15, 2021
  34. 2/2 packfile: freshen the mtime of packfile by bump fileSun Chao via GitGitGadget, Aug 15, 2021

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.