- Notifications
You must be signed in to change notification settings - Fork4.9k
Commitf4d7f1a
committed
Fix incorrect order of operations during sinval reset processing.
We have to be sure that we have revalidated each nailed-in-cache relcacheentry before we try to use it to load data for some other relcache entry.The introduction of "mapped relations" in 9.0 broke this, because althoughwe updated the state kept in relmapper.c early enough, we failed topropagate that information into relcache entries soon enough; inparticular, we could try to fetch pg_class rows out of pg_class beforewe'd updated its relcache entry's rd_node.relNode value from the map.This bug accounts for Dave Gould's report of failures after "vacuum fullpg_class", and I believe that there is risk for other system catalogsas well.The core part of the fix is to copy relmapper data into the relcacheentries during "phase 1" in RelationCacheInvalidate(), before they'll beused in "phase 2". To try to future-proof the code against other similarbugs, I also rearranged the order in which nailed relations are visitedduring phase 2: now it's pg_class first, then pg_class_oid_index, thenother nailed relations. This should ensure that RelationClearRelation canapply RelationReloadIndexInfo to all nailed indexes without risking useof not-yet-revalidated relcache entries.Back-patch to 9.0 where the relation mapper was introduced.1 parent7b0d0e9 commitf4d7f1a
1 file changed
+34
-23
lines changedLines changed: 34 additions & 23 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
2104 | 2104 |
| |
2105 | 2105 |
| |
2106 | 2106 |
| |
2107 |
| - | |
2108 |
| - | |
2109 |
| - | |
2110 |
| - | |
2111 |
| - | |
| 2107 | + | |
| 2108 | + | |
| 2109 | + | |
| 2110 | + | |
| 2111 | + | |
2112 | 2112 |
| |
2113 | 2113 |
| |
2114 | 2114 |
| |
| |||
2120 | 2120 |
| |
2121 | 2121 |
| |
2122 | 2122 |
| |
| 2123 | + | |
| 2124 | + | |
| 2125 | + | |
| 2126 | + | |
| 2127 | + | |
2123 | 2128 |
| |
2124 | 2129 |
| |
2125 | 2130 |
| |
| |||
2130 | 2135 |
| |
2131 | 2136 |
| |
2132 | 2137 |
| |
2133 |
| - | |
| 2138 | + | |
2134 | 2139 |
| |
2135 | 2140 |
| |
2136 | 2141 |
| |
| |||
2144 | 2149 |
| |
2145 | 2150 |
| |
2146 | 2151 |
| |
| 2152 | + | |
| 2153 | + | |
| 2154 | + | |
| 2155 | + | |
| 2156 | + | |
| 2157 | + | |
| 2158 | + | |
| 2159 | + | |
| 2160 | + | |
| 2161 | + | |
2147 | 2162 |
| |
2148 | 2163 |
| |
2149 |
| - | |
2150 |
| - | |
2151 |
| - | |
| 2164 | + | |
| 2165 | + | |
| 2166 | + | |
| 2167 | + | |
| 2168 | + | |
| 2169 | + | |
2152 | 2170 |
| |
2153 |
| - | |
2154 |
| - | |
2155 |
| - | |
2156 |
| - | |
2157 |
| - | |
2158 |
| - | |
2159 |
| - | |
2160 |
| - | |
2161 |
| - | |
| 2171 | + | |
| 2172 | + | |
| 2173 | + | |
| 2174 | + | |
| 2175 | + | |
2162 | 2176 |
| |
| 2177 | + | |
| 2178 | + | |
2163 | 2179 |
| |
2164 | 2180 |
| |
2165 | 2181 |
| |
| |||
2170 | 2186 |
| |
2171 | 2187 |
| |
2172 | 2188 |
| |
2173 |
| - | |
2174 |
| - | |
2175 |
| - | |
2176 |
| - | |
2177 |
| - | |
2178 | 2189 |
| |
2179 | 2190 |
| |
2180 | 2191 |
| |
|
0 commit comments
Comments
(0)