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

[PATCH 0/2] Multi-pack-index: Fix "too many file descriptors" bug

From
Derrick Stolee via GitGitGadget <gitgitgadget@gmail.com>
Date
Apr 29, 2019, 16:18 UTC
Message-ID
<pull.182.git.gitgitgadget@gmail.com>

Thanks to Jeff H for finding the problem with the multi-pack-index regarding many packs. Specifically: if we open too many packs, the close_one_pack() method cannot find the packs from the multi-pack-index to close.

Jeff already fixed the problem explicitly in 'git multi-pack-index verify' which would hit this issue 100% of the time we had 2000+ packs. This issue could still happen in 'git rev-list --all --objects' if there are enough packs containing commits and trees. This series fixes the issue.

The basic solution is to add packs from the multi-pack-index into the packed_git struct as they are opened. To avoid performance issues, add a multi_pack_index bit to the packed_git struct. Midx-aware algorithms can then ignore those packs.

There was a very subtle issue that happens during a 'git repack': we clear the multi-pack-index after possibly reading some packs from it, thus leaving some packs in the packed_git struct but having a NULL multi_pack_index in the object store. This informs the change to close_midx().

I'm based on a recent 'master' commit that contains the following three branches due to nearby changes causing conflicts if I pick only Jeff's change as a base:

jh/midx-verify-too-many-packs jk/server-info-rabbit-hole bc/hash-transition-16

Thanks, -Stolee
Derrick Stolee (2):
  midx: pass a repository pointer
  midx: add packs to packed_git linked list
 builtin/multi-pack-index.c |  2 +-
 builtin/pack-objects.c     |  2 +-
 midx.c                     | 42 +++++++++++++++++++++++++-------------
 midx.h                     |  7 ++++---
 object-store.h             |  9 ++------
 packfile.c                 | 30 ++++++++-------------------
 sha1-name.c                |  6 ++++++
 7 files changed, 51 insertions(+), 47 deletions(-)
base-commit: 83232e38648b51abbcbdb56c94632b6906cc85a6
Published-As: https://github.com/gitgitgadget/git/releases/tag/pr-182%2Fderrickstolee%2Fmany-packs-v1
Fetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-182/derrickstolee/many-packs-v1
Pull-Request: https://github.com/gitgitgadget/git/pull/182
-- 
gitgitgadget
Next: Derrick Stolee via GitGitGadget
Message 1 of 5 in “Multi-pack-index: Fix "too many file descriptors" bug”
  1. 0/2 Multi-pack-index: Fix "too many file descriptors" bugDerrick Stolee via GitGitGadget, Apr 29, 2019
  2. 1/2 midx: pass a repository pointerDerrick Stolee via GitGitGadget, Apr 29, 2019
  3. Junio C HamanoMay 7, 2019
  4. Derrick StoleeMay 8, 2019
  5. 2/2 midx: add packs to packed_git linked listDerrick Stolee via GitGitGadget, Apr 29, 2019

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.