- Notifications
You must be signed in to change notification settings - Fork4.9k
Commit9d52311
committed
Avoid possible crash while finishing up a heap rewrite.
end_heap_rewrite was not careful to ensure that the target relationis open at the smgr level before performing its final smgrimmedsync.In ordinary cases this is no problem, because it would have beenopened earlier during the rewrite. However a crash can be reproducedby re-clustering an empty table with CLOBBER_CACHE_ALWAYS enabled.Although that exact scenario does not crash in v13, I think that'sa chance result of unrelated planner changes, and the problem islikely still reachable with other test cases. The true proximatecause of this failure is commitc6b9204, which replaced a call toheap_sync (which was careful about opening smgr) with a direct callto smgrimmedsync. Hence, back-patch to v13.Amul Sul, per report from Neha Sharma; cosmetic changesand test case by me.Discussion:https://postgr.es/m/CANiYTQsU7yMFpQYnv=BrcRVqK_3U3mtAzAsJCaqtzsDHfsUbdQ@mail.gmail.com1 parent22e1943 commit9d52311
File tree
3 files changed
+16
-1
lines changed- src
- backend/access/heap
- test/regress
- expected
- sql
3 files changed
+16
-1
lines changedLines changed: 5 additions & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
323 | 323 |
| |
324 | 324 |
| |
325 | 325 |
| |
326 |
| - | |
327 | 326 |
| |
328 | 327 |
| |
329 | 328 |
| |
| 329 | + | |
330 | 330 |
| |
331 | 331 |
| |
332 | 332 |
| |
| |||
339 | 339 |
| |
340 | 340 |
| |
341 | 341 |
| |
| 342 | + | |
| 343 | + | |
| 344 | + | |
342 | 345 |
| |
| 346 | + | |
343 | 347 |
| |
344 | 348 |
| |
345 | 349 |
| |
|
Lines changed: 5 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
439 | 439 |
| |
440 | 440 |
| |
441 | 441 |
| |
| 442 | + | |
| 443 | + | |
| 444 | + | |
| 445 | + | |
| 446 | + | |
442 | 447 |
| |
443 | 448 |
| |
444 | 449 |
| |
|
Lines changed: 6 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
196 | 196 |
| |
197 | 197 |
| |
198 | 198 |
| |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
199 | 205 |
| |
200 | 206 |
| |
201 | 207 |
| |
|
0 commit comments
Comments
(0)