Clean up backend-exit-time cleanup behavior. Use on_shmem_exit callbacks
Tom Lane <tgl@sss.pgh.pa.us>
Clean up backend-exit-time cleanup behavior. Use on_shmem_exit callbacks to ensure that we have released buffer refcounts and so forth, rather than putting ad-hoc operations before (some of the calls to) proc_exit. Add commentary to discourage future hackers from repeating that mistake.
Files
| Path | Change | +/− |
|---|---|---|
| src/backend/access/transam/xact.c | modified | +16 −14 |
| src/backend/access/transam/xlog.c | modified | +6 −6 |
| src/backend/commands/trigger.c | modified | +2 −4 |
| src/backend/libpq/pqcomm.c | modified | +6 −2 |
| src/backend/storage/buffer/buf_init.c | modified | +50 −6 |
| src/backend/storage/lmgr/proc.c | modified | +6 −7 |
| src/backend/tcop/postgres.c | modified | +54 −46 |
| src/backend/utils/error/elog.c | modified | +13 −13 |
| src/backend/utils/init/postinit.c | modified | +85 −24 |
| src/include/access/xlog.h | modified | +2 −2 |
| src/include/commands/trigger.h | modified | +2 −2 |
| src/include/libpq/libpq.h | modified | +1 −2 |
| src/include/storage/bufmgr.h | modified | +2 −1 |
| src/include/utils/elog.h | modified | +10 −10 |