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

Re: [PATCH 1/2] pack-revindex: drop hash table

From
Eric Sunshine <sunshine@sunshineco.com>
Date
Dec 21, 2015, 07:06 UTC
Message-ID
<CAPig+cTD+qknnZ3rH7skcTxZA16AL0BPbLT5ZaJdwwu_d-i=Jw@mail.gmail.com>
In-Reply-To
<20151221061948.GA25763@sigill.intra.peff.net>
On Mon, Dec 21, 2015 at 1:19 AM, Jeff King <peff@peff.net> wrote:
Show 17 quoted lines
> The main entry point to the pack-revindex code is
> find_pack_revindex(). This calls revindex_for_pack(), which
> lazily computes and caches the revindex for the pack.
>
> We store the cache in a very simple hash table. It's created
> by init_pack_revindex(), which inserts an entry for every
> packfile we know about, and we never grow or shrink the
> hash. If we ever need the revindex for a pack that isn't in
> the hash, we die() with an internal error.
>
> This can lead to a race, because we may load more packs
> after having called init_pack_revindex(). For example,
> imagine we have one process which needs to look at the
> revindex for a variety of objects (e.g., cat-file's
> "%(objectsize:disk)" format).  Simultaneously, git-gc is
> running, which is doing a `git repack -ad` is running. We
> might hit a sequence like:
Probably want to drop one of the "is running"s...
Previous: Jeff KingNext: Jeff King
Message 3 of 4 in “pack-revindex: drop hash table”
  1. 1/2 pack-revindex: drop hash tableJeff King, Dec 21, 2015
  2. 2/2 pack-revindex: store entries directly in packed_gitJeff King, Dec 21, 2015
  3. Eric SunshineDec 21, 2015
  4. Jeff KingDec 21, 2015

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.