Use signals for postmaster death on Linux.
Thomas Munro <tmunro@postgresql.org>
Use signals for postmaster death on Linux. Linux provides a way to ask for a signal when your parent process dies. Use that to make PostmasterIsAlive() very cheap. Based on a suggestion from Andres Freund. Author: Thomas Munro, Heikki Linnakangas Reviewed-By: Michael Paquier Discussion: https://postgr.es/m/7261eb39-0369-f2f4-1bb5-62f3b6083b5e%40iki.fi Discussion: https://postgr.es/m/20180411002643.6buofht4ranhei7k%40alap3.anarazel.de
Files
| Path | Change | +/− |
|---|---|---|
| configure | modified | +1 −1 |
| configure.in | modified | +1 −1 |
| src/backend/storage/ipc/latch.c | modified | +3 −3 |
| src/backend/storage/ipc/pmsignal.c | modified | +112 −13 |
| src/backend/utils/init/miscinit.c | modified | +4 −0 |
| src/include/pg_config.h.in | modified | +3 −0 |
| src/include/pg_config.h.win32 | modified | +3 −0 |
| src/include/storage/pmsignal.h | modified | +32 −1 |
Discussion
- Excessive PostmasterIsAlive calls slow down WAL redo 31 messages · 2018-04-05 → 2018-07-11
- PATCH: Keep one postmaster monitoring pipe per process 37 messages · 2016-09-15 → 2018-11-23