Commit 38b2779
committed
Avoid possible hang during smart shutdown.
If a smart shutdown occurs just as a child is starting up, and the
child subsequently becomes a walsender, there is a race condition:
the postmaster might count the exstant backends, determine that there
is one normal backend, and wait for it to die off. Had the walsender
transition already occurred before the postmaster counted, it would
have proceeded with the shutdown.
To fix this, have each child that transforms into a walsender kick
the postmaster just after doing so, so that the state machine is
certain to advance.
Fujii Masao1 parent d518d6a commit 38b2779
File tree
3 files changed
+11
-2
lines changed- src
- backend
- postmaster
- replication
- include/storage
3 files changed
+11
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2890 | 2890 | | |
2891 | 2891 | | |
2892 | 2892 | | |
2893 | | - | |
2894 | | - | |
| 2893 | + | |
| 2894 | + | |
2895 | 2895 | | |
2896 | 2896 | | |
2897 | 2897 | | |
| |||
4284 | 4284 | | |
4285 | 4285 | | |
4286 | 4286 | | |
| 4287 | + | |
| 4288 | + | |
| 4289 | + | |
| 4290 | + | |
| 4291 | + | |
| 4292 | + | |
| 4293 | + | |
4287 | 4294 | | |
4288 | 4295 | | |
4289 | 4296 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
361 | 361 | | |
362 | 362 | | |
363 | 363 | | |
| 364 | + | |
364 | 365 | | |
365 | 366 | | |
366 | 367 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
29 | 29 | | |
30 | 30 | | |
31 | 31 | | |
| 32 | + | |
32 | 33 | | |
33 | 34 | | |
34 | 35 | | |
| |||
0 commit comments