Re: [PATCH] midx.c: clear auxiliary MIDX files first
- From
Taylor Blau <me@ttaylorr.com>
- Date
- Oct 26, 2022, 19:59 UTC
- Message-ID
- <Y1mRr04M9+5wUs3q@nand.local>
- In-Reply-To
- <143a588a-c98b-733b-2b23-34a87ca89431@github.com>
On Wed, Oct 26, 2022 at 09:31:28AM -0400, Derrick Stolee wrote:
Show 24 quoted lines
> On 10/26/22 1:41 AM, Jeff King wrote: > > On Tue, Oct 25, 2022 at 02:25:20PM -0400, Taylor Blau wrote: > > > >> Since they were added in c528e17966 (pack-bitmap: write multi-pack > >> bitmaps, 2021-08-31), the routine to remove MIDXs removed the > >> multi-pack-index file itself before removing its associated .bitmap and > >> .rev file(s), if any. > >> > >> This creates a window where a MIDX's .bitmap file exists without its > >> corresponding MIDX. If a reader tries to load a MIDX bitmap during that > >> time, they will get a warning, and the MIDX bitmap code will gracefully > >> degrade. > >> > >> Remove this window entirely by removing the MIDX last, and removing its > >> auxiliary files first. > > > > We remove that window, but don't we create a new one where a reader may > > see the midx but not the bitmap? That won't generate a warning (it just > > looks like a midx that never had a bitmap generated), but it will cause > > the reader to follow the slow, non-bitmap path. > > Yes, this is the worrisome direction. The midx is read first, then that > points to the .bitmap file (based on its trailing hash). If the midx isn't > there, then the .bitmap will not be read.
Yes, thinking on it more I agree with this and (the elided) analysis below.
Let's drop this one. Thanks, both!
Thanks, Taylor