pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
pgsql: Fix waits of REINDEX CONCURRENTLY for indexes with predicates or
5+ messages / 1 participants
[nested] [flat]

* pgsql: Fix waits of REINDEX CONCURRENTLY for indexes with predicates or
@ 2024-09-09 04:50 Michael Paquier <michael@paquier.xyz>
  0 siblings, 0 replies; 5+ messages in thread

From: Michael Paquier @ 2024-09-09 04:50 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

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
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/5bbdfa8a18dc56d3e64aa723a68e02e897cb5ec3

Modified Files
--------------
src/backend/commands/indexcmds.c                   | 13 +++++-
src/test/modules/injection_points/Makefile         |  2 +-
.../injection_points/expected/reindex_conc.out     | 51 ++++++++++++++++++++++
src/test/modules/injection_points/meson.build      |  1 +
.../modules/injection_points/sql/reindex_conc.sql  | 28 ++++++++++++
5 files changed, 92 insertions(+), 3 deletions(-)



^ permalink  raw  reply  [nested|flat] 5+ messages in thread

* pgsql: Fix waits of REINDEX CONCURRENTLY for indexes with predicates or
@ 2024-09-09 04:50 Michael Paquier <michael@paquier.xyz>
  0 siblings, 0 replies; 5+ messages in thread

From: Michael Paquier @ 2024-09-09 04:50 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

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_17_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/cd6b2ae3e7f64c881cb0159a2f9fc8d475e06d82

Modified Files
--------------
src/backend/commands/indexcmds.c                   | 13 +++++-
src/test/modules/injection_points/Makefile         |  2 +-
.../injection_points/expected/reindex_conc.out     | 51 ++++++++++++++++++++++
src/test/modules/injection_points/meson.build      |  1 +
.../modules/injection_points/sql/reindex_conc.sql  | 28 ++++++++++++
5 files changed, 92 insertions(+), 3 deletions(-)



^ permalink  raw  reply  [nested|flat] 5+ messages in thread

* pgsql: Fix waits of REINDEX CONCURRENTLY for indexes with predicates or
@ 2024-09-09 04:50 Michael Paquier <michael@paquier.xyz>
  0 siblings, 0 replies; 5+ messages in thread

From: Michael Paquier @ 2024-09-09 04:50 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

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_16_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/edb0f6e41b09d261326c5340acad3a2cea59d718

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



^ permalink  raw  reply  [nested|flat] 5+ messages in thread

* pgsql: Fix waits of REINDEX CONCURRENTLY for indexes with predicates or
@ 2024-09-09 04:50 Michael Paquier <michael@paquier.xyz>
  0 siblings, 0 replies; 5+ messages in thread

From: Michael Paquier @ 2024-09-09 04:50 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

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_15_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/239837a708cc2c6f27d96ddb3faf89691f2a22cd

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



^ permalink  raw  reply  [nested|flat] 5+ messages in thread

* pgsql: Fix waits of REINDEX CONCURRENTLY for indexes with predicates or
@ 2024-09-09 04:50 Michael Paquier <michael@paquier.xyz>
  0 siblings, 0 replies; 5+ messages in thread

From: Michael Paquier @ 2024-09-09 04:50 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

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(-)



^ permalink  raw  reply  [nested|flat] 5+ messages in thread


end of thread, other threads:[~2024-09-09 04:50 UTC | newest]

Thread overview: 5+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2024-09-09 04:50 pgsql: Fix waits of REINDEX CONCURRENTLY for indexes with predicates or Michael Paquier <michael@paquier.xyz>
2024-09-09 04:50 pgsql: Fix waits of REINDEX CONCURRENTLY for indexes with predicates or Michael Paquier <michael@paquier.xyz>
2024-09-09 04:50 pgsql: Fix waits of REINDEX CONCURRENTLY for indexes with predicates or Michael Paquier <michael@paquier.xyz>
2024-09-09 04:50 pgsql: Fix waits of REINDEX CONCURRENTLY for indexes with predicates or Michael Paquier <michael@paquier.xyz>
2024-09-09 04:50 pgsql: Fix waits of REINDEX CONCURRENTLY for indexes with predicates or Michael Paquier <michael@paquier.xyz>

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