Don't destroy SMgrRelations at relcache invalidation
Heikki Linnakangas <heikki.linnakangas@iki.fi>
Don't destroy SMgrRelations at relcache invalidation With commit 21d9c3ee4e, SMgrRelations remain valid until end of transaction (or longer if they're "pinned"). Relcache invalidation can happen in the middle of a transaction, so we must not destroy them at relcache invalidation anymore. This was revealed by failures in the 'constraints' test in buildfarm animals using -DCLOBBER_CACHE_ALWAYS. That started failing with commit 8af2565248, which was the first commit that started to rely on an SMgrRelation living until end of transaction. Diagnosed-by: Tomas Vondra, Thomas Munro Reviewed-by: Thomas Munro Discussion: https://www.postgresql.org/message-id/CA%2BhUKGK%2B5DOmLaBp3Z7C4S-Yv6yoROvr1UncjH2S1ZbPT8D%2BZg%40mail.gmail.com
Files
| Path | Change | +/− |
|---|---|---|
| src/backend/storage/smgr/smgr.c | modified | +0 −2 |
| src/backend/utils/cache/relcache.c | modified | +3 −7 |
Discussion
- Failures in constraints regression test, "read only 0 of 8192 bytes" 24 messages · 2024-03-02 → 2024-06-21