postgresql/src/backend
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
..
access Rename SetSingleFuncCall() to InitMaterializedSRF() 2022-10-18 10:22:35 +09:00
backup Rename shadowed local variables 2022-10-05 21:01:41 +13:00
bootstrap Store GUC data in a memory context, instead of using malloc(). 2022-10-14 12:10:48 -04:00
catalog Record dependencies of a cast on other casts that it requires. 2022-10-17 14:02:05 -04:00
commands Improve errhint for ALTER SUBSCRIPTION ADD/DROP PUBLICATION 2022-10-18 11:46:58 +02:00
executor Remove unnecessary semicolons after goto labels 2022-10-10 15:08:38 +07:00
foreign Rename SetSingleFuncCall() to InitMaterializedSRF() 2022-10-18 10:22:35 +09:00
jit meson: Add windows resource files 2022-10-05 09:56:05 -07:00
lib meson: Add initial version of meson based build system 2022-09-21 22:37:17 -07:00
libpq Refactor regular expression handling in hba.c 2022-10-19 10:08:49 +09:00
main meson: Add initial version of meson based build system 2022-09-21 22:37:17 -07:00
nodes Revert 56-bit relfilenode change and follow-up commits. 2022-09-28 09:55:28 -04:00
optimizer Fix confusion about havingQual vs hasHavingQual in planner. 2022-10-18 10:44:34 -04:00
parser Record dependencies of a cast on other casts that it requires. 2022-10-17 14:02:05 -04:00
partitioning Remove unnecessary uses of Abs() 2022-10-07 13:29:33 +02:00
po meson: Add initial version of meson based build system 2022-09-21 22:37:17 -07:00
port meson: Add initial version of meson based build system 2022-09-21 22:37:17 -07:00
postmaster Rework shutdown callback of archiver modules 2022-10-19 14:06:56 +09:00
regex Remove uses of register due to incompatibility with C++17 and up 2022-09-24 12:08:37 -07:00
replication Fix typos in logical/launcher.c 2022-10-19 10:27:23 +09:00
rewrite Reject non-ON-SELECT rules that are named "_RETURN". 2022-10-17 12:14:39 -04:00
snowball meson: Add support for building with precompiled headers 2022-10-06 17:19:30 -07:00
statistics Rename shadowed local variables 2022-10-05 21:01:41 +13:00
storage Rename SetSingleFuncCall() to InitMaterializedSRF() 2022-10-18 10:22:35 +09:00
tcop Store GUC data in a memory context, instead of using malloc(). 2022-10-14 12:10:48 -04:00
tsearch Introduce t_isalnum() to replace t_isalpha() || t_isdigit() tests. 2022-10-06 11:08:56 -04:00
utils Refactor regular expression handling in hba.c 2022-10-19 10:08:49 +09:00
.gitignore
Makefile Move gramparse.h to src/backend/parser 2022-09-14 10:57:13 +07:00
common.mk Blind attempt to fix LLVM dependency in the backend 2022-09-15 10:53:48 +07:00
meson.build meson: Add support for building with precompiled headers 2022-10-06 17:19:30 -07:00
nls.mk NLS: Put list of available languages into LINGUAS files 2022-07-13 08:19:17 +02:00