Opclass parameters of indexes lost after REINDEX CONCURRENTLY

From: Michael Paquier <michael(at)paquier(dot)xyz>
To: Postgres hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Opclass parameters of indexes lost after REINDEX CONCURRENTLY
Date: 2021-10-30 08:28:11
Message-ID: YX0CG/QpLXcPr8HJ@paquier.xyz
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi all,

While reviewing the code for opclass parameters with indexes, I have
noticed that opclass parameters are lost after a concurrent reindex.
As we use a IndexInfo to hold the information of the new index when
creating a copy of the old one, it is just a matter of making sure
that ii_OpclassOptions is filled appropriately, but that was missed by
911e702.

Attached is a patch to fix the issue. After a concurrent reindex, we
would not finish with a corrupted index, just with one rebuilt with
default opclass parameter values.

Any objections or comments?
--
Michael

Attachment Content-Type Size
reindex-conc-opclass.patch text/x-diff 3.0 KB

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Bharath Rupireddy 2021-10-30 09:31:42 Re: logical decoding/replication: new functions pg_ls_logicaldir and pg_ls_replslotdir
Previous Message Bharath Rupireddy 2021-10-30 07:54:39 Re: Predefined role pg_maintenance for VACUUM, ANALYZE, CHECKPOINT.