Re: pg_index.indisreplident and invalid indexes - Mailing list pgsql-hackers

From Dmitry Dolgov
Subject Re: pg_index.indisreplident and invalid indexes
Date
Msg-id 20200828081537.2j2ur6jtnmbpuvw5@localhost
Whole thread Raw
In response to pg_index.indisreplident and invalid indexes  (Michael Paquier <michael@paquier.xyz>)
Responses Re: pg_index.indisreplident and invalid indexes  (Michael Paquier <michael@paquier.xyz>)
List pgsql-hackers
> On Thu, Aug 27, 2020 at 11:57:21AM +0900, Michael Paquier wrote:
>
> I think that this problem is similar to indisclustered, and that we
> had better set indisreplident to false when clearing indisvalid for an
> index concurrently dropped.  This would prevent problems with ALTER
> TABLE of course, but also the relcache.
>
> Any objections to the attached?  I am not sure that this is worth a
> backpatch as that's unlikely going to be a problem in the field, so
> I'd like to fix this issue only on HEAD.  This exists since 9.4 and
> the introduction of replica identities.

Thanks for the patch. It sounds right, so no objections from me. But I
wonder if something similar has to be done also for
index_concurrently_swap function?

    /*
     * Mark the new index as valid, and the old index as invalid similarly to
     * what index_set_state_flags() does.
     */
    newIndexForm->indisvalid = true;
    oldIndexForm->indisvalid = false;
    oldIndexForm->indisclustered = false;



pgsql-hackers by date:

Previous
From: Masahiko Sawada
Date:
Subject: Re: recovering from "found xmin ... from before relfrozenxid ..."
Next
From: Michael Paquier
Date:
Subject: Re: pg_index.indisreplident and invalid indexes