forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commitcb2e7dd
committed
Prevent pgstats from getting confused when relkind of a relation changes
When the relkind of a relache entry changes, because a table is converted intoa view, pgstats can get confused in 15+, leading to crashes or assertionfailures.For HEAD, Tom fixed this inb23cd18, by removing support for converting atable to a view, removing the source of the inconsistency. This commit justadds an assertion that a relcache entry's relkind does not change, just incase we end up with another case of that in the future. As there's no cases ofchanging relkind anymore, we can't add a test that that's handled correctly.For 15, fix the problem by not maintaining the association with the old pgstatentry when the relkind changes during a relcache invalidation processing. Inthat case the pgstat entry needs to be unlinked first, to avoidPgStat_TableStatus->relation getting out of sync. Also add a test reproducingthe issues.No known problem exists in 11-14, so just add the test there.Reported-by: vignesh C <vignesh21@gmail.com>Author: Andres Freund <andres@anarazel.de>Reviewed-by: Tom Lane <tgl@sss.pgh.pa.us>Discussion:https://postgr.es/m/CALDaNm2yXz+zOtv7y5zBd5WKT8O0Ld3YxikuU3dcyCvxF7gypA@mail.gmail.comDiscussion:https://postgr.es/m/CALDaNm3oZA-8Wbps2Jd1g5_Gjrr-x3YWrJPek-mF5Asrrvz2Dg@mail.gmail.comBackpatch: 15-1 parent7ac0f8d commitcb2e7dd
1 file changed
+7
-0
lines changedLines changed: 7 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
2661 | 2661 |
| |
2662 | 2662 |
| |
2663 | 2663 |
| |
| 2664 | + | |
| 2665 | + | |
| 2666 | + | |
| 2667 | + | |
| 2668 | + | |
| 2669 | + | |
| 2670 | + | |
2664 | 2671 |
| |
2665 | 2672 |
| |
2666 | 2673 |
| |
|
0 commit comments
Comments
(0)