forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit6344bc0
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 parent303b26c commit6344bc0
2 files changed
+48
-1
lines changedLines changed: 25 additions & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1990 | 1990 |
| |
1991 | 1991 |
| |
1992 | 1992 |
| |
| 1993 | + | |
| 1994 | + | |
| 1995 | + | |
| 1996 | + | |
| 1997 | + | |
| 1998 | + | |
| 1999 | + | |
| 2000 | + | |
| 2001 | + | |
| 2002 | + | |
| 2003 | + | |
| 2004 | + | |
| 2005 | + | |
| 2006 | + | |
| 2007 | + | |
| 2008 | + | |
| 2009 | + | |
| 2010 | + | |
| 2011 | + | |
| 2012 | + | |
| 2013 | + | |
| 2014 | + | |
| 2015 | + | |
1993 | 2016 |
| |
1994 | 2017 |
| |
1995 | 2018 |
| |
| |||
2021 | 2044 |
| |
2022 | 2045 |
| |
2023 | 2046 |
| |
2024 |
| - | |
| 2047 | + | |
2025 | 2048 |
| |
2026 | 2049 |
| |
2027 | 2050 |
| |
| |||
2096 | 2119 |
| |
2097 | 2120 |
| |
2098 | 2121 |
| |
| 2122 | + |
Lines changed: 23 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
686 | 686 |
| |
687 | 687 |
| |
688 | 688 |
| |
| 689 | + | |
| 690 | + | |
| 691 | + | |
| 692 | + | |
| 693 | + | |
| 694 | + | |
| 695 | + | |
| 696 | + | |
| 697 | + | |
| 698 | + | |
| 699 | + | |
| 700 | + | |
| 701 | + | |
| 702 | + | |
| 703 | + | |
| 704 | + | |
| 705 | + | |
| 706 | + | |
| 707 | + | |
| 708 | + | |
| 709 | + | |
| 710 | + | |
| 711 | + | |
689 | 712 |
| |
690 | 713 |
| |
691 | 714 |
|
0 commit comments
Comments
(0)