Re: Failed Assert in pgstat_assoc_relation
Andres Freund <andres@anarazel.de>
From: Andres Freund <andres@anarazel.de>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: vignesh C <vignesh21@gmail.com>, PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>
Date: 2022-12-02T04:46:35Z
Lists: pgsql-hackers
Attachments
- relcache_assoc_v2.diff (text/x-diff) patch v2
Hi, On 2022-11-28 16:33:20 -0500, Tom Lane wrote: > Andres Freund <andres@anarazel.de> writes: > > Something like the attached. Still needs a bit of polish, e.g. adding the test > > case from above. > > > I'm a bit uncomfortable adding a function call below > > * Perform swapping of the relcache entry contents. Within this > > * process the old entry is momentarily invalid, so there *must* be no > > * possibility of CHECK_FOR_INTERRUPTS within this sequence. Do it in > > * all-in-line code for safety. > > Ugh. I don't know what pgstat_unlink_relation does, but assuming > that it can never throw an error seems like a pretty bad idea, I don't think it'd be an issue - it just resets the pointer from a pgstat entry to the relcache entry. But you're right: > Can't that part be done outside the critical section? we can do that. See the attached. Do we have any cases of relcache entries changing their relkind? Greetings, Andres Freund
Commits
-
Prevent pgstats from getting confused when relkind of a relation changes
- af3517c15c84 11.19 landed
- 35b99a18f5fb 12.14 landed
- 7944d2d8c78b 13.10 landed
- cb2e7ddfe571 16.0 landed
- 6344bc0974dc 14.7 landed
- c6a60471a1a5 15.2 landed
-
Remove logic for converting a table to a view.
- b23cd185fd54 16.0 landed