Re: Apply worker can pick an invalid index for REPLICA IDENTITY FULL lookups

From: Ajin Cherian <itsajin(at)gmail(dot)com>
To: Mihail Nikalayeu <mihailnikalayeu(at)gmail(dot)com>
Cc: PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>, Amit Kapila <amit(dot)kapila16(at)gmail(dot)com>, onderkalaci(at)gmail(dot)com
Subject: Re: Apply worker can pick an invalid index for REPLICA IDENTITY FULL lookups
Date: 2026-08-26 00:21:35
Message-ID: CAFPTHDac6x9nU8fKq3tKD+84Nr09xFE+-ioxTn4_aHy+1OQDsA@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Sun, Aug 23, 2026 at 5:56 AM Mihail Nikalayeu
<mihailnikalayeu(at)gmail(dot)com> wrote:
>
> Hello,
>
> The fix and a reproducer are in the attachments.
>
> Affects 16 and up, from 89e46da5e51.
>

The patch looks good, just a small suggestion that the function header
of IsIndexUsableForReplicaIdentityFull() probably could do with a
comment so that future callers are aware of this potential shortfall.
Something like:

* Note that this function does not check indisvalid. Callers that are
* selecting an index to use for future lookups must check indisvalid
* themselves and reject invalid indexes

regards,
Ajin Cherian
Fujitsu Australia

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Richard Guo 2026-08-26 00:58:36 Re: scary patch contest
Previous Message Robert Haas 2026-08-26 00:17:53 Re: scary patch contest