forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit9a86f03
committed
Rearrange postmaster's startup sequence for better syslogger results.
This is a second try at what commit57431a9 tried to do, namely,launch the syslogger before we open postmaster sockets so that ourmessages about the sockets end up in the syslogger files. Thatcommit fell foul of a bunch of subtle issues caused by trying tolaunch a postmaster child process before creating shared memory.Rather than messing with that interaction, let's postpone openingthe sockets till after we launch the syslogger.This would not have been terribly safe before commit7de19fb,because we relied on socket opening to detect whether any competingpostmasters were using the same port number. But now that we chooseIPC keys without regard to the port number, there's no interactionto worry about.Also delay creation of the external PID file (if requested) till afterthe sockets are open, since external code could plausibly be relyingon that ordering of events. And postpone most of the work ofRemovePgTempFiles() so that that potentially-slow processing stillhappens after we make the external PID file. We have to be a bitcareful about that last though: as noted in the discussion subsequent tobug #15804, EXEC_BACKEND builds still have to clear the parameter-filetemp dir before launching the syslogger.Patch by me; thanks to Michael Paquier for review/testing.Discussion:https://postgr.es/m/15804-3721117bf40fb654@postgresql.org1 parent75f46ea commit9a86f03
File tree
4 files changed
+116
-102
lines changed- src
- backend
- postmaster
- storage/file
- include
- storage
- utils
4 files changed
+116
-102
lines changedLines changed: 108 additions & 94 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
993 | 993 |
| |
994 | 994 |
| |
995 | 995 |
| |
996 |
| - | |
| 996 | + | |
| 997 | + | |
| 998 | + | |
| 999 | + | |
| 1000 | + | |
| 1001 | + | |
| 1002 | + | |
| 1003 | + | |
| 1004 | + | |
| 1005 | + | |
| 1006 | + | |
| 1007 | + | |
| 1008 | + | |
| 1009 | + | |
| 1010 | + | |
| 1011 | + | |
| 1012 | + | |
| 1013 | + | |
| 1014 | + | |
| 1015 | + | |
| 1016 | + | |
| 1017 | + | |
| 1018 | + | |
| 1019 | + | |
| 1020 | + | |
| 1021 | + | |
| 1022 | + | |
| 1023 | + | |
| 1024 | + | |
| 1025 | + | |
| 1026 | + | |
| 1027 | + | |
| 1028 | + | |
| 1029 | + | |
| 1030 | + | |
| 1031 | + | |
| 1032 | + | |
| 1033 | + | |
| 1034 | + | |
| 1035 | + | |
| 1036 | + | |
| 1037 | + | |
| 1038 | + | |
| 1039 | + | |
| 1040 | + | |
| 1041 | + | |
| 1042 | + | |
| 1043 | + | |
| 1044 | + | |
| 1045 | + | |
| 1046 | + | |
| 1047 | + | |
| 1048 | + | |
| 1049 | + | |
| 1050 | + | |
| 1051 | + | |
| 1052 | + | |
| 1053 | + | |
| 1054 | + | |
| 1055 | + | |
| 1056 | + | |
| 1057 | + | |
| 1058 | + | |
| 1059 | + | |
| 1060 | + | |
| 1061 | + | |
| 1062 | + | |
| 1063 | + | |
| 1064 | + | |
| 1065 | + | |
| 1066 | + | |
| 1067 | + | |
| 1068 | + | |
| 1069 | + | |
| 1070 | + | |
| 1071 | + | |
| 1072 | + | |
| 1073 | + | |
| 1074 | + | |
| 1075 | + | |
| 1076 | + | |
| 1077 | + | |
| 1078 | + | |
| 1079 | + | |
| 1080 | + | |
| 1081 | + | |
| 1082 | + | |
| 1083 | + | |
| 1084 | + | |
| 1085 | + | |
| 1086 | + | |
| 1087 | + | |
| 1088 | + | |
| 1089 | + | |
| 1090 | + | |
| 1091 | + | |
| 1092 | + | |
| 1093 | + | |
| 1094 | + | |
| 1095 | + | |
| 1096 | + | |
| 1097 | + | |
| 1098 | + | |
| 1099 | + | |
| 1100 | + | |
| 1101 | + | |
| 1102 | + | |
997 | 1103 |
| |
998 | 1104 |
| |
999 | 1105 |
| |
| |||
1172 | 1278 |
| |
1173 | 1279 |
| |
1174 | 1280 |
| |
1175 |
| - | |
1176 |
| - | |
1177 |
| - | |
1178 |
| - | |
1179 |
| - | |
1180 |
| - | |
1181 |
| - | |
1182 |
| - | |
1183 |
| - | |
1184 |
| - | |
1185 |
| - | |
1186 |
| - | |
1187 |
| - | |
1188 |
| - | |
1189 |
| - | |
1190 |
| - | |
1191 |
| - | |
1192 |
| - | |
1193 |
| - | |
1194 |
| - | |
1195 |
| - | |
1196 |
| - | |
1197 |
| - | |
1198 |
| - | |
1199 |
| - | |
1200 |
| - | |
1201 |
| - | |
1202 |
| - | |
1203 |
| - | |
1204 |
| - | |
1205 |
| - | |
1206 |
| - | |
1207 |
| - | |
1208 | 1281 |
| |
1209 | 1282 |
| |
1210 |
| - | |
| 1283 | + | |
1211 | 1284 |
| |
1212 | 1285 |
| |
1213 | 1286 |
| |
1214 | 1287 |
| |
1215 |
| - | |
1216 |
| - | |
1217 |
| - | |
1218 |
| - | |
1219 |
| - | |
1220 | 1288 |
| |
1221 | 1289 |
| |
1222 | 1290 |
| |
| |||
1247 | 1315 |
| |
1248 | 1316 |
| |
1249 | 1317 |
| |
1250 |
| - | |
1251 |
| - | |
1252 |
| - | |
1253 |
| - | |
1254 |
| - | |
1255 |
| - | |
1256 |
| - | |
1257 |
| - | |
1258 |
| - | |
1259 |
| - | |
1260 |
| - | |
1261 |
| - | |
1262 |
| - | |
1263 |
| - | |
1264 |
| - | |
1265 |
| - | |
1266 |
| - | |
1267 |
| - | |
1268 |
| - | |
1269 |
| - | |
1270 |
| - | |
1271 |
| - | |
1272 |
| - | |
1273 |
| - | |
1274 |
| - | |
1275 |
| - | |
1276 |
| - | |
1277 |
| - | |
1278 |
| - | |
1279 |
| - | |
1280 |
| - | |
1281 |
| - | |
1282 |
| - | |
1283 |
| - | |
1284 |
| - | |
1285 |
| - | |
1286 |
| - | |
1287 |
| - | |
1288 |
| - | |
1289 |
| - | |
1290 |
| - | |
1291 |
| - | |
1292 |
| - | |
1293 |
| - | |
1294 |
| - | |
1295 |
| - | |
1296 |
| - | |
1297 |
| - | |
1298 |
| - | |
1299 |
| - | |
1300 |
| - | |
1301 |
| - | |
1302 |
| - | |
1303 |
| - | |
1304 | 1318 |
| |
1305 | 1319 |
| |
1306 | 1320 |
| |
|
Lines changed: 4 additions & 7 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
307 | 307 |
| |
308 | 308 |
| |
309 | 309 |
| |
310 |
| - | |
311 |
| - | |
312 | 310 |
| |
313 | 311 |
| |
314 | 312 |
| |
| |||
2919 | 2917 |
| |
2920 | 2918 |
| |
2921 | 2919 |
| |
2922 |
| - | |
| 2920 | + | |
| 2921 | + | |
| 2922 | + | |
2923 | 2923 |
| |
2924 |
| - | |
2925 |
| - | |
2926 |
| - | |
2927 | 2924 |
| |
2928 | 2925 |
| |
2929 | 2926 |
| |
| |||
2941 | 2938 |
| |
2942 | 2939 |
| |
2943 | 2940 |
| |
2944 |
| - | |
| 2941 | + | |
2945 | 2942 |
| |
2946 | 2943 |
| |
2947 | 2944 |
| |
|
Lines changed: 2 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
135 | 135 |
| |
136 | 136 |
| |
137 | 137 |
| |
| 138 | + | |
| 139 | + | |
138 | 140 |
| |
139 | 141 |
| |
140 | 142 |
| |
|
Lines changed: 2 additions & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
28 | 28 |
| |
29 | 29 |
| |
30 | 30 |
| |
31 |
| - | |
| 31 | + | |
| 32 | + | |
32 | 33 |
| |
33 | 34 |
| |
34 | 35 |
| |
|
0 commit comments
Comments
(0)