forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit7e784d1
committed
Improve client error messages for immediate-stop situations.
Up to now, if the DBA issued "pg_ctl stop -m immediate", the messagesent to clients was the same as for a crash-and-restart situation.This is confusing, not least because the message claims that thedatabase will soon be up again, something we have no businesspredicting.Improve things so that we can generate distinct messages for the twocases (and also recognize an ad-hoc SIGQUIT, should somebody try that).To do that, add a field to pmsignal.c's shared memory data structurethat the postmaster sets just before broadcasting SIGQUIT to itschildren. No interlocking seems to be necessary; the interveningsignal-sending and signal-receipt should sufficiently serialize accessesto the field. Hence, this isn't any riskier than the existing usagesof pmsignal.c.We might in future extend this idea to improve otherpostmaster-to-children signal scenarios, although none of themcurrently seem to be as badly overloaded as SIGQUIT.Discussion:https://postgr.es/m/559291.1608587013@sss.pgh.pa.us1 parent90fbf7c commit7e784d1
File tree
4 files changed
+86
-16
lines changed- src
- backend
- postmaster
- storage/ipc
- tcop
- include/storage
4 files changed
+86
-16
lines changedLines changed: 4 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
218 | 218 |
| |
219 | 219 |
| |
220 | 220 |
| |
| 221 | + | |
221 | 222 |
| |
222 | 223 |
| |
223 | 224 |
| |
| |||
2887 | 2888 |
| |
2888 | 2889 |
| |
2889 | 2890 |
| |
| 2891 | + | |
| 2892 | + | |
2890 | 2893 |
| |
2891 | 2894 |
| |
2892 | 2895 |
| |
| |||
3464 | 3467 |
| |
3465 | 3468 |
| |
3466 | 3469 |
| |
| 3470 | + | |
3467 | 3471 |
| |
3468 | 3472 |
| |
3469 | 3473 |
| |
|
Lines changed: 37 additions & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1 | 1 |
| |
2 | 2 |
| |
3 | 3 |
| |
4 |
| - | |
| 4 | + | |
5 | 5 |
| |
6 | 6 |
| |
7 | 7 |
| |
| |||
55 | 55 |
| |
56 | 56 |
| |
57 | 57 |
| |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
58 | 62 |
| |
59 | 63 |
| |
60 | 64 |
| |
| |||
65 | 69 |
| |
66 | 70 |
| |
67 | 71 |
| |
68 |
| - | |
| 72 | + | |
69 | 73 |
| |
| 74 | + | |
| 75 | + | |
70 | 76 |
| |
71 | 77 |
| |
72 | 78 |
| |
| |||
134 | 140 |
| |
135 | 141 |
| |
136 | 142 |
| |
| 143 | + | |
137 | 144 |
| |
138 | 145 |
| |
139 | 146 |
| |
| |||
171 | 178 |
| |
172 | 179 |
| |
173 | 180 |
| |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
174 | 209 |
| |
175 | 210 |
| |
176 | 211 |
| |
|
Lines changed: 32 additions & 13 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
67 | 67 |
| |
68 | 68 |
| |
69 | 69 |
| |
| 70 | + | |
70 | 71 |
| |
71 | 72 |
| |
72 | 73 |
| |
| |||
2752 | 2753 |
| |
2753 | 2754 |
| |
2754 | 2755 |
| |
2755 |
| - | |
2756 |
| - | |
| 2756 | + | |
| 2757 | + | |
2757 | 2758 |
| |
2758 | 2759 |
| |
2759 | 2760 |
| |
| |||
2788 | 2789 |
| |
2789 | 2790 |
| |
2790 | 2791 |
| |
2791 |
| - | |
2792 |
| - | |
| 2792 | + | |
| 2793 | + | |
2793 | 2794 |
| |
2794 |
| - | |
2795 |
| - | |
2796 |
| - | |
2797 |
| - | |
2798 |
| - | |
2799 |
| - | |
2800 |
| - | |
2801 |
| - | |
2802 |
| - | |
| 2795 | + | |
| 2796 | + | |
| 2797 | + | |
| 2798 | + | |
| 2799 | + | |
| 2800 | + | |
| 2801 | + | |
| 2802 | + | |
| 2803 | + | |
| 2804 | + | |
| 2805 | + | |
| 2806 | + | |
| 2807 | + | |
| 2808 | + | |
| 2809 | + | |
| 2810 | + | |
| 2811 | + | |
| 2812 | + | |
| 2813 | + | |
| 2814 | + | |
| 2815 | + | |
| 2816 | + | |
| 2817 | + | |
| 2818 | + | |
| 2819 | + | |
| 2820 | + | |
| 2821 | + | |
2803 | 2822 |
| |
2804 | 2823 |
| |
2805 | 2824 |
| |
|
Lines changed: 13 additions & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1 | 1 |
| |
2 | 2 |
| |
3 | 3 |
| |
4 |
| - | |
| 4 | + | |
5 | 5 |
| |
6 | 6 |
| |
7 | 7 |
| |
| |||
45 | 45 |
| |
46 | 46 |
| |
47 | 47 |
| |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
48 | 58 |
| |
49 | 59 |
| |
50 | 60 |
| |
| |||
55 | 65 |
| |
56 | 66 |
| |
57 | 67 |
| |
| 68 | + | |
| 69 | + | |
58 | 70 |
| |
59 | 71 |
| |
60 | 72 |
| |
|
0 commit comments
Comments
(0)