forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commitece4bd9
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 parentbc44044 commitece4bd9
1 file changed
+14
-9
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3536 | 3536 | | |
3537 | 3537 | | |
3538 | 3538 | | |
3539 | | - | |
3540 | | - | |
| 3539 | + | |
| 3540 | + | |
| 3541 | + | |
3541 | 3542 | | |
3542 | 3543 | | |
3543 | 3544 | | |
| |||
3584 | 3585 | | |
3585 | 3586 | | |
3586 | 3587 | | |
3587 | | - | |
| 3588 | + | |
3588 | 3589 | | |
3589 | 3590 | | |
3590 | 3591 | | |
| |||
4262 | 4263 | | |
4263 | 4264 | | |
4264 | 4265 | | |
4265 | | - | |
| 4266 | + | |
4266 | 4267 | | |
4267 | 4268 | | |
4268 | 4269 | | |
| |||
4279 | 4280 | | |
4280 | 4281 | | |
4281 | 4282 | | |
4282 | | - | |
4283 | | - | |
4284 | | - | |
| 4283 | + | |
| 4284 | + | |
| 4285 | + | |
| 4286 | + | |
| 4287 | + | |
| 4288 | + | |
4285 | 4289 | | |
4286 | 4290 | | |
4287 | 4291 | | |
4288 | | - | |
| 4292 | + | |
| 4293 | + | |
4289 | 4294 | | |
4290 | | - | |
| 4295 | + | |
4291 | 4296 | | |
4292 | 4297 | | |
4293 | 4298 | | |
| |||
0 commit comments
Comments
(0)