Fix waits of REINDEX CONCURRENTLY for indexes with predicates or expressions
Michael Paquier <michael@paquier.xyz>
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
Files
| Path | Change | +/− |
|---|---|---|
| src/backend/commands/indexcmds.c | modified | +11 −2 |
| src/test/modules/injection_points/expected/reindex_conc.out | added | +51 −0 |
| src/test/modules/injection_points/Makefile | modified | +1 −1 |
| src/test/modules/injection_points/meson.build | modified | +1 −0 |
| src/test/modules/injection_points/sql/reindex_conc.sql | added | +28 −0 |
Discussion
- PATCH: Issue with set_indexsafe_procflags in ReindexRelationConcurrently 3 messages · 2024-09-06 → 2024-09-09