forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit4b6106c
committed
Prevent incorrect updates of pg_index while reindexing pg_index itself.
The places that attempt to change pg_index.indcheckxmin during a reindexingoperation cannot be executed safely if pg_index itself is the subject ofthe operation. This is the explanation for a couple of recent reports ofVACUUM FULL failing withERROR: duplicate key value violates unique constraint "pg_index_indexrelid_index"DETAIL: Key (indexrelid)=(2678) already exists.However, there isn't any real need to update indcheckxmin in such asituation, if we assume that pg_index can never contain a truly broken HOTchain. This assumption holds if new indexes are never created on it duringconcurrent operations, which is something we don't consider safe for anysystem catalog, not just pg_index. Accordingly, modify the code to notmanipulate indcheckxmin when reindexing any system catalog.Back-patch to 8.3, where HOT was introduced. The known failure scenariosinvolve 9.0-style VACUUM FULL, so there might not be any real risk before9.0, but let's not assume that.1 parentff5565f commit4b6106c
1 file changed
+24
-4
lines changedLines changed: 24 additions & 4 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1770 | 1770 |
| |
1771 | 1771 |
| |
1772 | 1772 |
| |
| 1773 | + | |
| 1774 | + | |
| 1775 | + | |
| 1776 | + | |
| 1777 | + | |
| 1778 | + | |
| 1779 | + | |
1773 | 1780 |
| |
1774 | 1781 |
| |
1775 | 1782 |
| |
| |||
1827 | 1834 |
| |
1828 | 1835 |
| |
1829 | 1836 |
| |
1830 |
| - | |
| 1837 | + | |
| 1838 | + | |
| 1839 | + | |
| 1840 | + | |
| 1841 | + | |
| 1842 | + | |
| 1843 | + | |
1831 | 1844 |
| |
1832 | 1845 |
| |
1833 | 1846 |
| |
| |||
2004 | 2017 |
| |
2005 | 2018 |
| |
2006 | 2019 |
| |
2007 |
| - | |
| 2020 | + | |
| 2021 | + | |
2008 | 2022 |
| |
2009 | 2023 |
| |
2010 | 2024 |
| |
| |||
2092 | 2106 |
| |
2093 | 2107 |
| |
2094 | 2108 |
| |
2095 |
| - | |
| 2109 | + | |
| 2110 | + | |
2096 | 2111 |
| |
2097 | 2112 |
| |
2098 | 2113 |
| |
| |||
2787 | 2802 |
| |
2788 | 2803 |
| |
2789 | 2804 |
| |
| 2805 | + | |
| 2806 | + | |
| 2807 | + | |
| 2808 | + | |
| 2809 | + | |
2790 | 2810 |
| |
2791 |
| - | |
| 2811 | + | |
2792 | 2812 |
| |
2793 | 2813 |
| |
2794 | 2814 |
| |
|
0 commit comments
Comments
(0)