Re: BUG #18630: Incorrect memory access inside ReindexIsProcessingIndex() on VACUUM

Michael Paquier <michael@paquier.xyz>

From: Michael Paquier <michael@paquier.xyz>
To: Tender Wang <tndrwang@gmail.com>
Cc: exclusion@gmail.com, pgsql-bugs@lists.postgresql.org
Date: 2024-09-27T00:45:12Z
Lists: pgsql-bugs
On Thu, Sep 26, 2024 at 03:24:25PM +0800, Tender Wang wrote:
> Agree. The attached patch LGTM.

I have fixed this issue and backpatched it all the way down for now.

One thing that we still lack is a set of reliable tests.  This can be
achieved with injection points, and that's much broader than only this
thread.  I'd like to get the coverage with two types of tests,
roughly:
- Isolation, with waits across the steps of REINDEX CONCURRENTLY, and
some concurrent operation.  This thread used one.
- SQL tests, where we could force errors in some code paths to get an
incorrect state.  Putting ourselves in a corner where there is an
invalid toast index is just one state.  CIC with a UNIQUE index gives
this possibility, but this just works for a "new" index, for early
stages of REINDEX CONCURRENTLY.
--
Michael

Commits

  1. Fix incorrect memory access in VACUUM FULL with invalid toast indexes