pgstat: Schedule per-backend pgstat shutdown via before_shmem_exit().
authorAndres Freund <andres@anarazel.de>
Fri, 6 Aug 2021 17:05:57 +0000 (10:05 -0700)
committerAndres Freund <andres@anarazel.de>
Sat, 7 Aug 2021 02:11:05 +0000 (19:11 -0700)
commitfb2c5028e63589c01fbdf8b031be824766dc7a68
tree2de940ef20e2b425a8f8defd845b7632c309b3a8
parenta1bb3d5dbe6a66ae73d7805a63b951793b5d55df
pgstat: Schedule per-backend pgstat shutdown via before_shmem_exit().

Previously on_shmem_exit() was used. The upcoming shared memory stats patch
uses DSM segments to store stats, which can not be used after the
dsm_backend_shutdown() call in shmem_exit().

The preceding commits were required to permit this change. This commit is
split off the shared memory stats patch to make it easier to isolate problems
caused by the ordering changes rather than the much larger changes in where
stats are stored.

Author: Andres Freund <andres@anarazel.de>
Author: Kyotaro Horiguchi <horikyota.ntt@gmail.com>
Discussion: https://postgr.es/m/20210405092914.mmxqe7j56lsjfsej@alap3.anarazel.de
Discussion: https://postgr.es/m/20210802164124.ufo5buo4apl6yuvs@alap3.anarazel.de
Discussion: https://postgr.es/m/20210803023612.iziacxk5syn2r4ut@alap3.anarazel.de
src/backend/postmaster/pgstat.c