postgresql/src
Nathan Bossart c627d944e6 Add built-in ERROR handling for archive callbacks.
Presently, the archiver process restarts when an archive callback
ERRORs.  To avoid this, archive module authors can use sigsetjmp(),
manage a memory context, etc., but that requires a lot of extra
code that will likely look roughly the same between modules.  This
commit adds basic archive callback ERROR handling to pgarch.c so
that module authors won't ordinarily need to worry about this.
While this built-in handler attempts to clean up anything that an
archive module could conceivably have left behind, it is possible
that some modules are doing unexpected things that require
additional cleanup.  Module authors should be sure to do any extra
required cleanup in a PG_CATCH block within the archiving callback.

The archiving callback is now called in a short-lived memory
context that the archiver process resets between invocations.  If a
module requires longer-lived storage, it must maintain its own
memory context.

Thanks to these changes, the basic_archive module can be greatly
simplified.

Suggested-by: Andres Freund
Reviewed-by: Andres Freund, Yong Li
Discussion: https://postgr.es/m/20230217215624.GA3131134%40nathanxps13
2024-04-02 22:28:11 -05:00
..
backend Add built-in ERROR handling for archive callbacks. 2024-04-02 22:28:11 -05:00
bin Add functions to binaryheap for efficient key removal and update. 2024-04-03 10:44:21 +09:00
common Add functions to binaryheap for efficient key removal and update. 2024-04-03 10:44:21 +09:00
fe_utils Allow dbname to be written as part of connstring via pg_basebackup's -R option. 2024-03-21 10:50:33 +05:30
include Improve eviction algorithm in ReorderBuffer using max-heap for many subtransactions. 2024-04-03 11:40:42 +09:00
interfaces Expose PQsocketPoll via libpq 2024-04-02 10:15:56 -04:00
makefiles Remove AIX support 2024-02-28 15:17:23 +04:00
pl Avoid possible longjmp-induced logic error in PLy_trigger_build_args. 2024-04-01 15:15:03 -04:00
port Refactor code for setting pg_popcount* function pointers. 2024-04-02 10:16:00 -05:00
template Remove AIX support 2024-02-28 15:17:23 +04:00
test Implement pg_wal_replay_wait() stored procedure 2024-04-02 22:48:03 +03:00
timezone Update time zone data files to tzdata release 2024a. 2024-02-01 15:57:53 -05:00
tools Add functions to binaryheap for efficient key removal and update. 2024-04-03 10:44:21 +09:00
tutorial Update copyright for 2024 2024-01-03 20:49:05 -05:00
.gitignore
DEVELOPERS
Makefile Remove distprep 2023-11-06 15:18:04 +01:00
Makefile.global.in Remove make function vpathsearch 2024-01-29 07:24:59 +01:00
Makefile.shlib Remove AIX support 2024-02-28 15:17:23 +04:00
meson.build Update copyright for 2024 2024-01-03 20:49:05 -05:00
nls-global.mk Remove distprep 2023-11-06 15:18:04 +01:00