forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit0d01c5b
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 parentcf0c446 commit0d01c5b
1 file changed
+37
-14
lines changedLines changed: 37 additions & 14 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
249 | 249 |
| |
250 | 250 |
| |
251 | 251 |
| |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
252 | 263 |
| |
253 | 264 |
| |
254 | 265 |
| |
| |||
258 | 269 |
| |
259 | 270 |
| |
260 | 271 |
| |
261 |
| - | |
262 | 272 |
| |
263 | 273 |
| |
264 | 274 |
| |
| |||
301 | 311 |
| |
302 | 312 |
| |
303 | 313 |
| |
304 |
| - | |
305 |
| - | |
306 | 314 |
| |
307 | 315 |
| |
308 | 316 |
| |
| |||
1238 | 1246 |
| |
1239 | 1247 |
| |
1240 | 1248 |
| |
| 1249 | + | |
1241 | 1250 |
| |
1242 | 1251 |
| |
1243 | 1252 |
| |
| |||
2583 | 2592 |
| |
2584 | 2593 |
| |
2585 | 2594 |
| |
| 2595 | + | |
2586 | 2596 |
| |
2587 | 2597 |
| |
2588 | 2598 |
| |
| |||
2605 | 2615 |
| |
2606 | 2616 |
| |
2607 | 2617 |
| |
2608 |
| - | |
2609 |
| - | |
2610 |
| - | |
| 2618 | + | |
| 2619 | + | |
| 2620 | + | |
2611 | 2621 |
| |
2612 | 2622 |
| |
2613 | 2623 |
| |
2614 | 2624 |
| |
2615 | 2625 |
| |
2616 |
| - | |
2617 |
| - | |
| 2626 | + | |
| 2627 | + | |
| 2628 | + | |
| 2629 | + | |
2618 | 2630 |
| |
2619 | 2631 |
| |
2620 | 2632 |
| |
| |||
2623 | 2635 |
| |
2624 | 2636 |
| |
2625 | 2637 |
| |
| 2638 | + | |
2626 | 2639 |
| |
2627 | 2640 |
| |
2628 | 2641 |
| |
| |||
3170 | 3183 |
| |
3171 | 3184 |
| |
3172 | 3185 |
| |
| 3186 | + | |
3173 | 3187 |
| |
| 3188 | + | |
| 3189 | + | |
3174 | 3190 |
| |
3175 | 3191 |
| |
3176 | 3192 |
| |
3177 | 3193 |
| |
3178 | 3194 |
| |
3179 | 3195 |
| |
3180 | 3196 |
| |
| 3197 | + | |
3181 | 3198 |
| |
3182 | 3199 |
| |
3183 | 3200 |
| |
| |||
3569 | 3586 |
| |
3570 | 3587 |
| |
3571 | 3588 |
| |
3572 |
| - | |
3573 |
| - | |
3574 |
| - | |
3575 |
| - | |
3576 |
| - | |
| 3589 | + | |
| 3590 | + | |
| 3591 | + | |
| 3592 | + | |
| 3593 | + | |
3577 | 3594 |
| |
3578 |
| - | |
| 3595 | + | |
| 3596 | + | |
3579 | 3597 |
| |
3580 | 3598 |
| |
3581 | 3599 |
| |
| |||
3595 | 3613 |
| |
3596 | 3614 |
| |
3597 | 3615 |
| |
| 3616 | + | |
3598 | 3617 |
| |
3599 | 3618 |
| |
3600 | 3619 |
| |
| |||
3726 | 3745 |
| |
3727 | 3746 |
| |
3728 | 3747 |
| |
| 3748 | + | |
3729 | 3749 |
| |
| 3750 | + | |
| 3751 | + | |
| 3752 | + | |
3730 | 3753 |
| |
3731 | 3754 |
| |
3732 | 3755 |
| |
|
0 commit comments
Comments
(0)