On Mon, 24 Aug 2026 at 21:23, Mihail Nikalayeu
<[email protected]> wrote:
>
> Hello, Miłosz!
>
> >  Any thoughts on moving the 'idxRel->rd_index->indisvalid' check into 
> > 'IsIndexUsableForReplicaIdentityFull()' itself?
>
> I initially thought about that approach too, but an assertion also
> uses that check.
> This is explained in the commit message:
>
> > Skip invalid indexes, as the planner does.  The test belongs here rather
> > than in IsIndexUsableForReplicaIdentityFull(), whose other caller is an
> > assertion that would then trip over an index DROP INDEX CONCURRENTLY has
> > just invalidated but that still finds tuples fine.
>

Hi Mihail,

I am able to reproduce the issue on HEAD and from PG16 to PG19.

I tested the patch on HEAD and it resolves the issue.
I also agree that the function 'FindUsableIndexForReplicaIdentityFull'
is appropriate. I have manually verified that adding the check in
'IsIndexUsableForReplicaIdentityFull' can cause the Assert to trigger,
when DROP INDEX CONCURRENTLY is run concurrently.

The patch along with changes provided by Amit, looks good to me.

Thanks,
Shlok Kyal


Reply via email to