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(). There does not seem to be any
reason to do ShutdownXLOG() via on_shmem_exit(), so change it.
Author: Andres Freund <
[email protected]>
Discussion: https://postgr.es/m/
20210405092914[email protected]
Discussion: https://postgr.es/m/
20210803023612[email protected]
/* Reset CurrentResourceOwner to nothing for the moment */
CurrentResourceOwner = NULL;
- on_shmem_exit(ShutdownXLOG, 0);
+ /*
+ * Use before_shmem_exit() so that ShutdownXLOG() can rely on DSM
+ * segments etc to work (which in turn is required for pgstats).
+ */
+ before_shmem_exit(ShutdownXLOG, 0);
}
/*