- Notifications
You must be signed in to change notification settings - Fork28
Commit73981cb
committed
Fix a problem introduced by my patch of 2010-01-12 that revised the way
relcache reload works. In the patched code, a relcache entry in process ofbeing rebuilt doesn't get unhooked from the relcache hash table; which meansthat if a cache flush occurs due to sinval queue overrun while we'rerebuilding it, the entry could get blown away by RelationCacheInvalidate,resulting in crash or misbehavior. Fix by ensuring that an entry beingrebuilt has positive refcount, so it won't be seen as a target for removalif a cache flush occurs. (This will mean that the entry gets rebuilt twicein such a scenario, but that's okay.) It appears that the problem can onlyarise within a transaction that has previously reassigned the relfilenode ofa pre-existing table, via TRUNCATE or a similar operation. Per bug #5412from Rusty Conover.Back-patch to 8.2, same as the patch that introduced the problem.I think that the failure can't actually occur in 8.2, since it lacks therd_newRelfilenodeSubid optimization, but let's make it work like the laterbranches anyway.Patch by Heikki, slightly editorialized on by me.1 parent9d137a7 commit73981cb
1 file changed
+31
-13
lines changedLines changed: 31 additions & 13 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
8 | 8 |
| |
9 | 9 |
| |
10 | 10 |
| |
11 |
| - | |
| 11 | + | |
12 | 12 |
| |
13 | 13 |
| |
14 | 14 |
| |
| |||
1823 | 1823 |
| |
1824 | 1824 |
| |
1825 | 1825 |
| |
1826 |
| - | |
1827 |
| - | |
1828 |
| - | |
| 1826 | + | |
| 1827 | + | |
1829 | 1828 |
| |
1830 |
| - | |
1831 |
| - | |
| 1829 | + | |
| 1830 | + | |
| 1831 | + | |
| 1832 | + | |
| 1833 | + | |
| 1834 | + | |
| 1835 | + | |
| 1836 | + | |
| 1837 | + | |
| 1838 | + | |
1832 | 1839 |
| |
1833 | 1840 |
| |
1834 | 1841 |
| |
1835 | 1842 |
| |
1836 | 1843 |
| |
1837 | 1844 |
| |
| 1845 | + | |
| 1846 | + | |
| 1847 | + | |
| 1848 | + | |
| 1849 | + | |
| 1850 | + | |
| 1851 | + | |
| 1852 | + | |
1838 | 1853 |
| |
1839 | 1854 |
| |
1840 | 1855 |
| |
| |||
2024 | 2039 |
| |
2025 | 2040 |
| |
2026 | 2041 |
| |
2027 |
| - | |
2028 |
| - | |
2029 | 2042 |
| |
2030 | 2043 |
| |
2031 | 2044 |
| |
2032 | 2045 |
| |
2033 | 2046 |
| |
2034 | 2047 |
| |
2035 | 2048 |
| |
| 2049 | + | |
| 2050 | + | |
| 2051 | + | |
| 2052 | + | |
2036 | 2053 |
| |
2037 |
| - | |
| 2054 | + | |
| 2055 | + | |
| 2056 | + | |
2038 | 2057 |
| |
2039 | 2058 |
| |
2040 | 2059 |
| |
2041 | 2060 |
| |
2042 | 2061 |
| |
2043 | 2062 |
| |
2044 |
| - | |
2045 |
| - | |
| 2063 | + | |
2046 | 2064 |
| |
2047 |
| - | |
| 2065 | + | |
| 2066 | + | |
2048 | 2067 |
| |
2049 | 2068 |
| |
2050 | 2069 |
| |
| |||
2373 | 2392 |
| |
2374 | 2393 |
| |
2375 | 2394 |
| |
2376 |
| - | |
2377 | 2395 |
| |
2378 | 2396 |
| |
2379 | 2397 |
| |
|
0 commit comments
Comments
(0)