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

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

From
Jeff King <peff@peff.net>
Date
Dec 21, 2015, 07:08 UTC
Message-ID
<20151221070828.GA3895@sigill.intra.peff.net>
In-Reply-To
<CAPig+cTD+qknnZ3rH7skcTxZA16AL0BPbLT5ZaJdwwu_d-i=Jw@mail.gmail.com>
On Mon, Dec 21, 2015 at 02:06:59AM -0500, Eric Sunshine wrote:
Show 20 quoted lines
> On Mon, Dec 21, 2015 at 1:19 AM, Jeff King <peff@peff.net> wrote:
> > 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...
Whoops. Not matter how many times I read it over...
It should be:
  Simultaneously, git-gc is running, which is doing a `git repack -ad`.
-Peff
Previous: Eric Sunshine
Message 4 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.