Hello,

On 2026-Jan-28, Mihail Nikalayeu wrote:

> > Actually, about this fragment ... if we track these ancestors for all
> > indexes, not just the ones that we consider as arbiters, don't we risk
> > doing something stupid when a completely unrelated index is being
> > reindexed?  Namely, also consider that unrelated index as arbiter.
> 
> Yes, such a thing may happen. It will not cause any error, because such an
> index will be used as artiber only if another compatible index in that same
> relation is present.  And additional_arbiters will be incremented.
> Probably you think linitial() is "root", but it is an immediate parent.

Okay, this sounds good.  Yes, I was thinking the linitial() was the
root, but a quick visit to get_partition_ancestors() clearly shows that
I was wrong.

> I am not sure I understood you correctly, but I added a comment about it.
> And about the opposite race + assert (not sure we need to keep it).

Interesting.  Actually, I think you're wrong on this, because an OID
wraparound could happen such that the old index has a high-numbered OID,
and the reindexed one has a lower one.  (This is not so preposterous as
it sounds, because the old index could have been created months ago, and
the counter recently wrapped around.)  I don't know if we can find a way
to order the index list to prevent this problem.

-- 
Álvaro Herrera               48°01'N 7°57'E  —  https://www.EnterpriseDB.com/
"Cómo ponemos nuestros dedos en la arcilla del otro. Eso es la amistad; jugar
al alfarero y ver qué formas se pueden sacar del otro" (C. Halloway en
La Feria de las Tinieblas, R. Bradbury)


Reply via email to