postgres.git / summary / log / commit / refs

commit    fb2c5028e63589c01fbdf8b031be824766dc7a68
Author:   Andres Freund <andres@anarazel.de>
Date:     Fri Aug 06 17:05:57 2021 +0000

    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 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/backend/postmaster/pgstat.c b/src/backend/postmaster/pgstat.c index 9664e7f256f..1b54ef74eb2 100644 --- a/src/backend/postmaster/pgstat.c +++ b/src/backend/postmaster/pgstat.c @@ -2992,7 +2992,7 @@ pgstat_initialize(void) prevWalUsage = pgWalUsage; /* Set up a process-exit hook to clean up */ - on_shmem_exit(pgstat_shutdown_hook, 0); + before_shmem_exit(pgstat_shutdown_hook, 0); #ifdef USE_ASSERT_CHECKING pgstat_is_initialized = true; [parent: a1bb3d5dbe6a]