All of lore.kernel.org
 help / color / mirror / Atom feed
From: Eric Sunshine <sunshine@sunshineco.com>
To: Jeff King <peff@peff.net>
Cc: Git List <git@vger.kernel.org>
Subject: Re: [PATCH 1/2] pack-revindex: drop hash table
Date: Mon, 21 Dec 2015 02:06:59 -0500	[thread overview]
Message-ID: <CAPig+cTD+qknnZ3rH7skcTxZA16AL0BPbLT5ZaJdwwu_d-i=Jw@mail.gmail.com> (raw)
In-Reply-To: <20151221061948.GA25763@sigill.intra.peff.net>

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...

  parent reply	other threads:[~2015-12-21  7:07 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-12-21  6:19 [PATCH 1/2] pack-revindex: drop hash table Jeff King
2015-12-21  6:20 ` [PATCH 2/2] pack-revindex: store entries directly in packed_git Jeff King
2015-12-21  7:06 ` Eric Sunshine [this message]
2015-12-21  7:08   ` [PATCH 1/2] pack-revindex: drop hash table Jeff King

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAPig+cTD+qknnZ3rH7skcTxZA16AL0BPbLT5ZaJdwwu_d-i=Jw@mail.gmail.com' \
    --to=sunshine@sunshineco.com \
    --cc=git@vger.kernel.org \
    --cc=peff@peff.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.