Subject: Re: [PATCH v3 4/8] reftable: ensure tables in a stack use sequential update indices

From: Patrick Steinhardt <[email-masked]>
Date: Thu, 25 Sep 2025 08:12:30 +0200

On Wed, Sep 24, 2025 at 01:13:51PM -0700, Karthik Nayak wrote:
> Junio C Hamano <[email-masked]> writes:
> 
> 
> >>> Now if we compact the second and the third table, the compaction will
> >>> realize that r2 is deleted and thus no longer needs to be part of the
> >>> compacted table. So the new state is:
> >>>
> >>>   - A base table with record r1 and update index r1.
> >>>   - The compacted table with record r3 with update index 3.
> >> ...
> >> However, I think your point  holds. I do think eventually we could
> >> optimize this to ensure that we do something like you described.
> >>
> >> I will make changes accordingly.
> >
> > If you allow gaps in the indices, it is a bit confusing to call them
> > "sequential"; "monotonically increasing" is less confusing and it
> > conveys the author's intention to allow gaps clear (otherwise the
> > author wouldn't be using such an awkward two-word phrase instead of
> > "sequencial").
> 
> Wouldn't 'monotonically increasing' suggest that
> prev_table.max_update_index can be equal to cur_table.min_update_index?
> I have locally changed it to 'ascending order' for similar reasons.

I guess the correct phrase here is "strictly monotonically increasing".

Patrick