pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Michael Paquier <michael@paquier.xyz>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Fix waits of REINDEX CONCURRENTLY for indexes with predicates or
Date: Mon, 09 Sep 2024 04:50:51 +0000
Message-ID: <E1snWMV-000FTa-97@gemulon.postgresql.org> (raw)

Fix waits of REINDEX CONCURRENTLY for indexes with predicates or expressions

As introduced by f9900df5f94, a REINDEX CONCURRENTLY job done for an
index with predicates or expressions would set PROC_IN_SAFE_IC in its
MyProc->statusFlags, causing it to be ignored by other concurrent
operations.

Such concurrent index rebuilds should never be ignored, as a predicate
or an expression could call a user-defined function that accesses a
different table than the table where the index is rebuilt.

A test that uses injection points is added, backpatched down to 17.
Michail has proposed a different test, but I have added something
simpler with more coverage.

Oversight in f9900df5f949.

Author: Michail Nikolaev
Discussion: https://postgr.es/m/CANtu0oj9A3kZVduFTG0vrmGnKB+DCHgEpzOp0qAyOgmks84j0w@mail.gmail.com
Backpatch-through: 14

Branch
------
REL_14_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/9021515488dd8f2dc43b7eaca127e113346f0449

Modified Files
--------------
src/backend/commands/indexcmds.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)



view thread (5+ messages)  latest in thread

Message-ID: <E1snWMV-000FTa-97@gemulon.postgresql.org>
Permalink:  ../E1snWMV-000FTa-97@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1snWMV-000FTa-97@gemulon.postgresql.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-committers@postgresql.org
  Cc: michael@paquier.xyz, pgsql-committers@lists.postgresql.org
  Subject: Re: pgsql: Fix waits of REINDEX CONCURRENTLY for indexes with predicates or
  In-Reply-To: <E1snWMV-000FTa-97@gemulon.postgresql.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox