forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commitcfdf4dc
committed
Add WL_EXIT_ON_PM_DEATH pseudo-event.
Users of the WaitEventSet and WaitLatch() APIs can now choose betweenasking for WL_POSTMASTER_DEATH and then handling it explicitly, or askingfor WL_EXIT_ON_PM_DEATH to trigger immediate exit on postmaster death.This reduces code duplication, since almost all callers want the latter.Repair all code that was previously ignoring postmaster death completely,or requesting the event but ignoring it, or requesting the event but thendoing an unconditional PostmasterIsAlive() call every time through itsevent loop (which is an expensive syscall on platforms for which we don'thave USE_POSTMASTER_DEATH_SIGNAL support).Assert that callers of WaitLatchXXX() under the postmaster remember toask for either WL_POSTMASTER_DEATH or WL_EXIT_ON_PM_DEATH, to preventfuture bugs.The only process that doesn't handle postmaster death is syslogger. Itwaits until all backends holding the write end of the syslog pipe(including the postmaster) have closed it by exiting, to be sure tocapture any parting messages. By using the WaitEventSet API directlyit avoids the new assertion, and as a by-product it may be slightlymore efficient on platforms that have epoll().Author: Thomas MunroReviewed-by: Kyotaro Horiguchi, Heikki Linnakangas, Tom LaneDiscussion:https://postgr.es/m/CAEepm%3D1TCviRykkUb69ppWLr_V697rzd1j3eZsRMmbXvETfqbQ%40mail.gmail.com,https://postgr.es/m/CAEepm=2LqHzizbe7muD7-2yHUbTOoF7Q+qkSD5Q41kuhttRTwA@mail.gmail.com1 parentd392e9b commitcfdf4dc
File tree
32 files changed
+174
-242
lines changed- contrib
- pg_prewarm
- postgres_fdw
- src
- backend
- access/transam
- executor
- libpq
- postmaster
- replication
- libpqwalreceiver
- logical
- storage
- ipc
- lmgr
- utils/adt
- include/storage
- test/modules
- test_shm_mq
- worker_spi
32 files changed
+174
-242
lines changedWhitespace-only changes.
Lines changed: 3 additions & 5 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
220 | 220 |
| |
221 | 221 |
| |
222 | 222 |
| |
223 |
| - | |
| 223 | + | |
224 | 224 |
| |
225 | 225 |
| |
226 | 226 |
| |
| |||
249 | 249 |
| |
250 | 250 |
| |
251 | 251 |
| |
252 |
| - | |
| 252 | + | |
253 | 253 |
| |
254 | 254 |
| |
255 | 255 |
| |
256 | 256 |
| |
257 |
| - | |
| 257 | + | |
258 | 258 |
| |
259 |
| - | |
260 |
| - | |
261 | 259 |
| |
262 | 260 |
| |
263 | 261 |
| |
|
Lines changed: 4 additions & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
546 | 546 |
| |
547 | 547 |
| |
548 | 548 |
| |
549 |
| - | |
| 549 | + | |
| 550 | + | |
550 | 551 |
| |
551 | 552 |
| |
552 | 553 |
| |
| |||
1152 | 1153 |
| |
1153 | 1154 |
| |
1154 | 1155 |
| |
1155 |
| - | |
| 1156 | + | |
| 1157 | + | |
1156 | 1158 |
| |
1157 | 1159 |
| |
1158 | 1160 |
| |
|
Lines changed: 3 additions & 7 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
692 | 692 |
| |
693 | 693 |
| |
694 | 694 |
| |
695 |
| - | |
| 695 | + | |
696 | 696 |
| |
697 | 697 |
| |
698 |
| - | |
699 |
| - | |
700 |
| - | |
701 |
| - | |
702 | 698 |
| |
703 | 699 |
| |
704 | 700 |
| |
| |||
815 | 811 |
| |
816 | 812 |
| |
817 | 813 |
| |
818 |
| - | |
819 |
| - | |
| 814 | + | |
| 815 | + | |
820 | 816 |
| |
821 | 817 |
| |
822 | 818 |
| |
|
Lines changed: 13 additions & 10 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
6189 | 6189 |
| |
6190 | 6190 |
| |
6191 | 6191 |
| |
6192 |
| - | |
6193 |
| - | |
6194 |
| - | |
6195 |
| - | |
| 6192 | + | |
| 6193 | + | |
| 6194 | + | |
| 6195 | + | |
6196 | 6196 |
| |
6197 | 6197 |
| |
6198 | 6198 |
| |
| |||
12093 | 12093 |
| |
12094 | 12094 |
| |
12095 | 12095 |
| |
12096 |
| - | |
12097 |
| - | |
12098 |
| - | |
| 12096 | + | |
| 12097 | + | |
| 12098 | + | |
| 12099 | + | |
| 12100 | + | |
12099 | 12101 |
| |
12100 | 12102 |
| |
12101 | 12103 |
| |
| |||
12269 | 12271 |
| |
12270 | 12272 |
| |
12271 | 12273 |
| |
12272 |
| - | |
12273 |
| - | |
12274 |
| - | |
| 12274 | + | |
| 12275 | + | |
| 12276 | + | |
| 12277 | + | |
12275 | 12278 |
| |
12276 | 12279 |
| |
12277 | 12280 |
| |
|
Lines changed: 4 additions & 4 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
764 | 764 |
| |
765 | 765 |
| |
766 | 766 |
| |
767 |
| - | |
768 |
| - | |
769 |
| - | |
770 |
| - | |
| 767 | + | |
| 768 | + | |
| 769 | + | |
| 770 | + | |
771 | 771 |
| |
772 | 772 |
| |
773 | 773 |
| |
|
Lines changed: 2 additions & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
383 | 383 |
| |
384 | 384 |
| |
385 | 385 |
| |
386 |
| - | |
| 386 | + | |
| 387 | + | |
387 | 388 |
| |
388 | 389 |
| |
389 | 390 |
| |
|
Lines changed: 2 additions & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
410 | 410 |
| |
411 | 411 |
| |
412 | 412 |
| |
413 |
| - | |
414 |
| - | |
| 413 | + | |
| 414 | + | |
415 | 415 |
| |
416 | 416 |
| |
417 | 417 |
| |
|
Lines changed: 2 additions & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
168 | 168 |
| |
169 | 169 |
| |
170 | 170 |
| |
171 |
| - | |
172 |
| - | |
| 171 | + | |
| 172 | + | |
173 | 173 |
| |
174 | 174 |
| |
175 | 175 |
| |
|
Lines changed: 4 additions & 12 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
628 | 628 |
| |
629 | 629 |
| |
630 | 630 |
| |
631 |
| - | |
632 | 631 |
| |
633 | 632 |
| |
634 | 633 |
| |
| |||
644 | 643 |
| |
645 | 644 |
| |
646 | 645 |
| |
647 |
| - | |
648 |
| - | |
649 |
| - | |
650 |
| - | |
| 646 | + | |
| 647 | + | |
| 648 | + | |
| 649 | + | |
651 | 650 |
| |
652 | 651 |
| |
653 | 652 |
| |
654 | 653 |
| |
655 | 654 |
| |
656 | 655 |
| |
657 |
| - | |
658 |
| - | |
659 |
| - | |
660 |
| - | |
661 |
| - | |
662 |
| - | |
663 |
| - | |
664 | 656 |
| |
665 | 657 |
| |
666 | 658 |
| |
|
Lines changed: 2 additions & 9 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
335 | 335 |
| |
336 | 336 |
| |
337 | 337 |
| |
338 |
| - | |
| 338 | + | |
339 | 339 |
| |
340 | 340 |
| |
341 | 341 |
| |
| |||
362 | 362 |
| |
363 | 363 |
| |
364 | 364 |
| |
365 |
| - | |
| 365 | + | |
366 | 366 |
| |
367 | 367 |
| |
368 | 368 |
| |
369 | 369 |
| |
370 | 370 |
| |
371 | 371 |
| |
372 |
| - | |
373 |
| - | |
374 |
| - | |
375 |
| - | |
376 |
| - | |
377 |
| - | |
378 |
| - | |
379 | 372 |
| |
380 | 373 |
| |
381 | 374 |
| |
|
Lines changed: 4 additions & 12 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
340 | 340 |
| |
341 | 341 |
| |
342 | 342 |
| |
343 |
| - | |
344 | 343 |
| |
345 | 344 |
| |
346 | 345 |
| |
| |||
541 | 540 |
| |
542 | 541 |
| |
543 | 542 |
| |
544 |
| - | |
545 |
| - | |
546 |
| - | |
547 |
| - | |
548 |
| - | |
549 |
| - | |
550 |
| - | |
551 |
| - | |
552 |
| - | |
553 |
| - | |
554 |
| - | |
| 543 | + | |
| 544 | + | |
| 545 | + | |
| 546 | + | |
555 | 547 |
| |
556 | 548 |
| |
557 | 549 |
| |
|
Lines changed: 3 additions & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
390 | 390 |
| |
391 | 391 |
| |
392 | 392 |
| |
| 393 | + | |
| 394 | + | |
393 | 395 |
| |
394 | 396 |
| |
395 | 397 |
| |
| |||
400 | 402 |
| |
401 | 403 |
| |
402 | 404 |
| |
403 |
| - | |
| 405 | + | |
404 | 406 |
| |
405 | 407 |
| |
406 | 408 |
| |
|
Lines changed: 23 additions & 15 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
168 | 168 |
| |
169 | 169 |
| |
170 | 170 |
| |
| 171 | + | |
171 | 172 |
| |
172 | 173 |
| |
173 | 174 |
| |
| |||
294 | 295 |
| |
295 | 296 |
| |
296 | 297 |
| |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
297 | 314 |
| |
298 | 315 |
| |
299 | 316 |
| |
300 | 317 |
| |
301 | 318 |
| |
302 | 319 |
| |
303 |
| - | |
| 320 | + | |
304 | 321 |
| |
305 | 322 |
| |
306 | 323 |
| |
| |||
436 | 453 |
| |
437 | 454 |
| |
438 | 455 |
| |
439 |
| - | |
440 | 456 |
| |
441 | 457 |
| |
442 |
| - | |
443 | 458 |
| |
444 |
| - | |
445 |
| - | |
446 | 459 |
| |
447 | 460 |
| |
448 | 461 |
| |
449 | 462 |
| |
450 | 463 |
| |
451 |
| - | |
452 |
| - | |
453 |
| - | |
454 |
| - | |
455 |
| - | |
| 464 | + | |
| 465 | + | |
456 | 466 |
| |
457 |
| - | |
| 467 | + | |
458 | 468 |
| |
459 | 469 |
| |
460 | 470 |
| |
| |||
501 | 511 |
| |
502 | 512 |
| |
503 | 513 |
| |
504 |
| - | |
505 |
| - | |
506 |
| - | |
507 |
| - | |
| 514 | + | |
| 515 | + | |
508 | 516 |
| |
509 | 517 |
| |
510 | 518 |
| |
|
Lines changed: 4 additions & 12 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
223 | 223 |
| |
224 | 224 |
| |
225 | 225 |
| |
226 |
| - | |
227 | 226 |
| |
228 | 227 |
| |
229 | 228 |
| |
| |||
276 | 275 |
| |
277 | 276 |
| |
278 | 277 |
| |
279 |
| - | |
280 |
| - | |
281 |
| - | |
282 |
| - | |
283 |
| - | |
284 |
| - | |
285 |
| - | |
286 |
| - | |
287 |
| - | |
288 |
| - | |
289 |
| - | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
290 | 282 |
| |
291 | 283 |
| |
292 | 284 |
| |
|
Lines changed: 1 addition & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1686 | 1686 |
| |
1687 | 1687 |
| |
1688 | 1688 |
| |
1689 |
| - | |
| 1689 | + | |
1690 | 1690 |
| |
1691 | 1691 |
| |
1692 | 1692 |
| |
|
0 commit comments
Comments
(0)