At update of non-LP_NORMAL TID, fail instead of corrupting page header.
Noah Misch <noah@leadboat.com>
At update of non-LP_NORMAL TID, fail instead of corrupting page header. The right mix of DDL and VACUUM could corrupt a catalog page header such that PageIsVerified() durably fails, requiring a restore from backup. This affects only catalogs that both have a syscache and have DDL code that uses syscache tuples to construct updates. One of the test permutations shows a variant not yet fixed. This makes !TransactionIdIsValid(TM_FailureData.xmax) possible with TM_Deleted. I think core and PGXN are indifferent to that. Per bug #17821 from Alexander Lakhin. Back-patch to v13 (all supported versions). The test case is v17+, since it uses INJECTION_POINT. Discussion: https://postgr.es/m/17821-dd8c334263399284@postgresql.org
Files
| Path | Change | +/− |
|---|---|---|
| src/backend/access/heap/heapam.c | modified | +48 −1 |
| src/backend/utils/cache/inval.c | modified | +3 −0 |
| src/include/access/tableam.h | modified | +2 −1 |
| src/test/modules/injection_points/expected/syscache-update-pruned_1.out | added | +86 −0 |
| src/test/modules/injection_points/expected/syscache-update-pruned.out | added | +87 −0 |
| src/test/modules/injection_points/injection_points--1.0.sql | modified | +8 −0 |
| src/test/modules/injection_points/Makefile | modified | +6 −3 |
| src/test/modules/injection_points/meson.build | modified | +3 −1 |
| src/test/modules/injection_points/regress_injection.c | added | +71 −0 |
| src/test/modules/injection_points/specs/syscache-update-pruned.spec | added | +179 −0 |
Discussion
- BUG #17821: Assertion failed in heap_update() due to heap pruning 13 messages · 2023-03-02 → 2025-04-02