forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commiteb7a6b9
committed
Fix query-cancel handling in spgdoinsert().
Knowing that a buggy opclass could cause an infinite insertion loop,spgdoinsert() intended to allow its loop to be interrupted by querycancel. However, that never actually worked, because in iterationsafter the first, we'd be holding buffer lock(s) which would causeInterruptHoldoffCount to be positive, preventing servicing of theinterrupt.To fix, check if an interrupt is pending, and if so fall out ofthe insertion loop and service the interrupt after we've releasedthe buffers. If it was indeed a query cancel, that's the end ofthe matter. If it was a non-canceling interrupt reason, make useof the existing provision to retry the whole insertion. (This isn'tas wasteful as it might seem, since any upper-level index tuples wealready created should be usable in the next attempt.)While there's no known instance of such a bug in existing releasebranches, it still seems like a good idea to back-patch this toall supported branches, since the behavior is fairly nasty if aloop does happen --- not only is it uncancelable, but it willquickly consume memory to the point of an OOM failure. In anycase, this code is certainly not working as intended.Per report from Dilip Kumar.Discussion:https://postgr.es/m/CAFiTN-uxP_soPhVG840tRMQTBmtA_f_Y8N51G7DKYYqDh7XN-A@mail.gmail.com1 parente47f93f commiteb7a6b9
1 file changed
+45
-7
lines changedLines changed: 45 additions & 7 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1905 | 1905 |
| |
1906 | 1906 |
| |
1907 | 1907 |
| |
1908 |
| - | |
1909 |
| - | |
| 1908 | + | |
| 1909 | + | |
1910 | 1910 |
| |
1911 | 1911 |
| |
1912 | 1912 |
| |
1913 | 1913 |
| |
1914 | 1914 |
| |
| 1915 | + | |
1915 | 1916 |
| |
1916 | 1917 |
| |
1917 | 1918 |
| |
| |||
2012 | 2013 |
| |
2013 | 2014 |
| |
2014 | 2015 |
| |
| 2016 | + | |
| 2017 | + | |
| 2018 | + | |
| 2019 | + | |
| 2020 | + | |
| 2021 | + | |
| 2022 | + | |
| 2023 | + | |
2015 | 2024 |
| |
2016 | 2025 |
| |
2017 | 2026 |
| |
2018 | 2027 |
| |
2019 | 2028 |
| |
2020 | 2029 |
| |
2021 | 2030 |
| |
2022 |
| - | |
| 2031 | + | |
| 2032 | + | |
| 2033 | + | |
| 2034 | + | |
| 2035 | + | |
| 2036 | + | |
2023 | 2037 |
| |
2024 |
| - | |
| 2038 | + | |
| 2039 | + | |
| 2040 | + | |
| 2041 | + | |
| 2042 | + | |
2025 | 2043 |
| |
2026 | 2044 |
| |
2027 | 2045 |
| |
| |||
2140 | 2158 |
| |
2141 | 2159 |
| |
2142 | 2160 |
| |
2143 |
| - | |
| 2161 | + | |
2144 | 2162 |
| |
2145 | 2163 |
| |
2146 |
| - | |
| 2164 | + | |
| 2165 | + | |
| 2166 | + | |
| 2167 | + | |
| 2168 | + | |
2147 | 2169 |
| |
2148 | 2170 |
| |
2149 | 2171 |
| |
| |||
2267 | 2289 |
| |
2268 | 2290 |
| |
2269 | 2291 |
| |
2270 |
| - | |
| 2292 | + | |
| 2293 | + | |
| 2294 | + | |
| 2295 | + | |
| 2296 | + | |
| 2297 | + | |
| 2298 | + | |
| 2299 | + | |
| 2300 | + | |
| 2301 | + | |
| 2302 | + | |
| 2303 | + | |
| 2304 | + | |
| 2305 | + | |
| 2306 | + | |
| 2307 | + | |
| 2308 | + | |
2271 | 2309 |
|
0 commit comments
Comments
(0)