forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit9c39d7a
committed
Fix postmaster's handling of a startup-process crash.
Ordinarily, a failure (unexpected exit status) of the startup subprocessshould be considered fatal, so the postmaster should just close up shopand quit. However, if we sent the startup process a SIGQUIT or SIGKILLsignal, the failure is hardly "unexpected", and we should attempt restart;this is necessary for recovery from ordinary backend crashes in hot-standbyscenarios. I attempted to implement the latter rule with a two-line patchin commit442231d, but it now emerges thatthat patch was a few bricks shy of a load: it failed to distinguish thecase of a signaled startup process from the case where the new startupprocess crashes before reaching database consistency. That resulted ininfinitely respawning a new startup process only to have it crash again.To handle this properly, we really must track whether we have sent the*current* startup process a kill signal. Rather than add yet anotherad-hoc boolean to the postmaster's state, I chose to unify this with theexisting RecoveryError flag into an enum tracking the startup process'sstate. That seems more consistent with the postmaster's general statemachine design.Back-patch to 9.0, like the previous patch.1 parent6327730 commit9c39d7a
1 file changed
+33
-14
lines changedLines changed: 33 additions & 14 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
275 | 275 |
| |
276 | 276 |
| |
277 | 277 |
| |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
278 | 289 |
| |
279 | 290 |
| |
280 | 291 |
| |
| |||
283 | 294 |
| |
284 | 295 |
| |
285 | 296 |
| |
286 |
| - | |
287 | 297 |
| |
288 | 298 |
| |
289 | 299 |
| |
| |||
326 | 336 |
| |
327 | 337 |
| |
328 | 338 |
| |
329 |
| - | |
330 |
| - | |
331 | 339 |
| |
332 | 340 |
| |
333 | 341 |
| |
| |||
1266 | 1274 |
| |
1267 | 1275 |
| |
1268 | 1276 |
| |
| 1277 | + | |
1269 | 1278 |
| |
1270 | 1279 |
| |
1271 | 1280 |
| |
| |||
2565 | 2574 |
| |
2566 | 2575 |
| |
2567 | 2576 |
| |
| 2577 | + | |
2568 | 2578 |
| |
2569 | 2579 |
| |
2570 | 2580 |
| |
| |||
2587 | 2597 |
| |
2588 | 2598 |
| |
2589 | 2599 |
| |
2590 |
| - | |
2591 |
| - | |
2592 |
| - | |
| 2600 | + | |
| 2601 | + | |
| 2602 | + | |
2593 | 2603 |
| |
2594 | 2604 |
| |
2595 | 2605 |
| |
2596 | 2606 |
| |
2597 | 2607 |
| |
2598 |
| - | |
2599 |
| - | |
| 2608 | + | |
| 2609 | + | |
| 2610 | + | |
| 2611 | + | |
2600 | 2612 |
| |
2601 | 2613 |
| |
2602 | 2614 |
| |
| |||
2605 | 2617 |
| |
2606 | 2618 |
| |
2607 | 2619 |
| |
| 2620 | + | |
2608 | 2621 |
| |
2609 | 2622 |
| |
2610 | 2623 |
| |
| |||
3115 | 3128 |
| |
3116 | 3129 |
| |
3117 | 3130 |
| |
| 3131 | + | |
3118 | 3132 |
| |
| 3133 | + | |
| 3134 | + | |
3119 | 3135 |
| |
3120 | 3136 |
| |
3121 | 3137 |
| |
3122 | 3138 |
| |
3123 | 3139 |
| |
3124 | 3140 |
| |
3125 | 3141 |
| |
| 3142 | + | |
3126 | 3143 |
| |
3127 | 3144 |
| |
3128 | 3145 |
| |
| |||
3502 | 3519 |
| |
3503 | 3520 |
| |
3504 | 3521 |
| |
3505 |
| - | |
3506 |
| - | |
3507 |
| - | |
3508 |
| - | |
3509 |
| - | |
| 3522 | + | |
| 3523 | + | |
| 3524 | + | |
| 3525 | + | |
| 3526 | + | |
3510 | 3527 |
| |
3511 |
| - | |
| 3528 | + | |
| 3529 | + | |
3512 | 3530 |
| |
3513 | 3531 |
| |
3514 | 3532 |
| |
| |||
3525 | 3543 |
| |
3526 | 3544 |
| |
3527 | 3545 |
| |
| 3546 | + | |
3528 | 3547 |
| |
3529 | 3548 |
| |
3530 | 3549 |
| |
|
0 commit comments
Comments
(0)