agora inbox for pgsql-committers@postgresql.org  
help / color / mirror / Atom feed
From: Álvaro Herrera <alvherre@kurilemu.de>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Fail REPACK in presence of invalid indexes, take 2
Date: Tue, 15 Sep 2026 16:28:25 +0000
Message-ID: <E1x6W1B-00000000SuJ-3Dgo@gemulon.postgresql.org> (raw)

Fail REPACK in presence of invalid indexes, take 2

Commit 0c5d6269614e was confused about which indexes are potentially
problematic to rebuild: we thought only !indisready indexes could fail
to rebuild, and thus would attempt to rebuild !indisvalid ones that are
"ready" (that is, being maintained by DML but not yet completed).
However, that's wrong, because it could be that the validation phase of
such an index failed or was interrupted partway through.  So, have
REPACK throw an error with all !indisvalid indexes, not just those
!indisready.

(!indisready implies !indisvalid, so this is an expansion of what
happened with the previous commit.)

Reported-by: shihao zhong <zhong950419@gmail.com>
Backpatch-through: 19
Discussion: https://postgr.es/m/CAGRkXqRA4YetT8Nu3+1-45+ffTwi2bd1d1eDFME39Y9OPRMytQ@mail.gmail.com

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/78142821dfd42a7ca1010811ce77ff7b96218741

Modified Files
--------------
doc/src/sgml/ref/repack.sgml  |  6 ++++++
src/backend/commands/repack.c | 15 ++++++++-------
2 files changed, 14 insertions(+), 7 deletions(-)



view thread (3+ messages)

Message-ID: <E1x6W1B-00000000SuJ-3Dgo@gemulon.postgresql.org>
Permalink:  ../E1x6W1B-00000000SuJ-3Dgo@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1x6W1B-00000000SuJ-3Dgo@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: alvherre@kurilemu.de, pgsql-committers@lists.postgresql.org
  Subject: Re: pgsql: Fail REPACK in presence of invalid indexes, take 2
  In-Reply-To: <E1x6W1B-00000000SuJ-3Dgo@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 agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox