postgresql/src
Michael Paquier 9668c4a661 Rework shutdown callback of archiver modules
As currently designed, with a callback registered in a ERROR_CLEANUP
block, the shutdown callback would get called twice when updating
archive_library on SIGHUP, which is something that we want to avoid to
ease the life of extension writers.

Anyway, an ERROR in the archiver process is treated as a FATAL, stopping
it immediately, hence there is no need for a ERROR_CLEANUP block.
Instead of that, the shutdown callback is not called upon
before_shmem_exit(), giving to the modules the opportunity to do any
cleanup actions before the server shuts down its subsystems.

While on it, this commit adds some testing coverage for the shutdown
callback.  Neither shell_archive nor basic_archive have been using it,
and one is added to shell_archive, whose trigger is checked in a TAP
test through a shutdown sequence.

Author: Nathan Bossart, Bharath Rupireddy
Reviewed-by: Kyotaro Horiguchi, Michael Paquier
Discussion: https://postgr.es/m/20221015221328.GB1821022@nathanxps13
Backpatch-through: 15
2022-10-19 14:06:56 +09:00
..
backend Rework shutdown callback of archiver modules 2022-10-19 14:06:56 +09:00
bin meson: Add support for building with precompiled headers 2022-10-06 17:19:30 -07:00
common meson: Add support for building with precompiled headers 2022-10-06 17:19:30 -07:00
fe_utils meson: Add support for building with precompiled headers 2022-10-06 17:19:30 -07:00
include Refactor regular expression handling in hba.c 2022-10-19 10:08:49 +09:00
interfaces libpq: Reset singlerow flag correctly in pipeline mode 2022-10-14 19:06:26 +02:00
makefiles autoconf: Rely on ar supporting index creation 2022-10-07 11:53:39 -07:00
pl Store GUC data in a memory context, instead of using malloc(). 2022-10-14 12:10:48 -04:00
port Use libc's snprintf, not sprintf, for special cases in snprintf.c. 2022-10-16 11:47:44 -04:00
template Move darwin sysroot determination into separate file 2022-09-01 16:54:19 -07:00
test Rework shutdown callback of archiver modules 2022-10-19 14:06:56 +09:00
timezone meson: Add windows resource files 2022-10-05 09:56:05 -07:00
tools Enhance make_ctags and make_etags. 2022-10-19 12:59:29 +09:00
tutorial Update copyright for 2022 2022-01-07 19:04:57 -05:00
.gitignore
DEVELOPERS
Makefile
Makefile.global.in autoconf: Rely on ar supporting index creation 2022-10-07 11:53:39 -07:00
Makefile.shlib autoconf: Rely on ar supporting index creation 2022-10-07 11:53:39 -07:00
meson.build meson: Add initial version of meson based build system 2022-09-21 22:37:17 -07:00
nls-global.mk Fix for make unportability 2022-07-13 09:15:01 +02:00