forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commitb1c2d76
committed
Fix possible core dump in parallel restore when using a TOC list.
Commit3eb9a5e unintentionally introduced an ordering dependencyinto restore_toc_entries_prefork(). The existing coding ofreduce_dependencies() contains a check to skip moving a TOC entryto the ready_list if it wasn't initially in the pending_list.This used to suffice to prevent reduce_dependencies() from trying tomove anything into the ready_list during restore_toc_entries_prefork(),because the pending_list stayed empty throughout that phase; but it nolonger does. The problem doesn't manifest unless the TOC has beenreordered by SortTocFromFile, which is how I missed it in testing.To fix, just add a test for ready_list == NULL, converting the callwith NULL from a poor man's sanity check into an explicit commandnot to touch TOC items' list membership. Clarify some of the commentsaround this; in particular, note the primary purpose of the check forpending_list membership, which is to ensure that we can't try to restorethe same item twice, in case a TOC list forces it to be restored beforeits dependency count goes to zero.Per report from Fabrízio de Royes Mello. Back-patch to 9.3, like theprevious commit.Discussion:https://postgr.es/m/CAFcNs+pjuv0JL_x4+=71TPUPjdLHOXA4YfT32myj_OrrZb4ohA@mail.gmail.com1 parent24620fc commitb1c2d76
1 file changed
+14
-9
lines changedLines changed: 14 additions & 9 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
3851 | 3851 |
| |
3852 | 3852 |
| |
3853 | 3853 |
| |
3854 |
| - | |
3855 |
| - | |
| 3854 | + | |
| 3855 | + | |
| 3856 | + | |
3856 | 3857 |
| |
3857 | 3858 |
| |
3858 | 3859 |
| |
| |||
3899 | 3900 |
| |
3900 | 3901 |
| |
3901 | 3902 |
| |
3902 |
| - | |
| 3903 | + | |
3903 | 3904 |
| |
3904 | 3905 |
| |
3905 | 3906 |
| |
| |||
4545 | 4546 |
| |
4546 | 4547 |
| |
4547 | 4548 |
| |
4548 |
| - | |
| 4549 | + | |
4549 | 4550 |
| |
4550 | 4551 |
| |
4551 | 4552 |
| |
| |||
4562 | 4563 |
| |
4563 | 4564 |
| |
4564 | 4565 |
| |
4565 |
| - | |
4566 |
| - | |
4567 |
| - | |
| 4566 | + | |
| 4567 | + | |
| 4568 | + | |
| 4569 | + | |
| 4570 | + | |
| 4571 | + | |
4568 | 4572 |
| |
4569 | 4573 |
| |
4570 | 4574 |
| |
4571 |
| - | |
| 4575 | + | |
| 4576 | + | |
4572 | 4577 |
| |
4573 |
| - | |
| 4578 | + | |
4574 | 4579 |
| |
4575 | 4580 |
| |
4576 | 4581 |
| |
|
0 commit comments
Comments
(0)