Re: fix archive module shutdown callback
Michael Paquier <michael@paquier.xyz>
From: Michael Paquier <michael@paquier.xyz>
To: Kyotaro Horiguchi <horikyota.ntt@gmail.com>
Cc: bharath.rupireddyforpostgres@gmail.com, nathandbossart@gmail.com, pgsql-hackers@postgresql.org
Date: 2022-10-17T05:47:15Z
Lists: pgsql-hackers
On Mon, Oct 17, 2022 at 02:30:52PM +0900, Kyotaro Horiguchi wrote: > At Mon, 17 Oct 2022 13:51:52 +0900, Michael Paquier <michael@paquier.xyz> wrote in >> I am not sure to understand what you mean here. The shutdown callback >> is available once the archiver process has loaded the library defined >> in archive_library (assuming it is itself in shared_preload_libraries) >> and you cannot call something that does not exist yet. So, yes, you > > I guess that the "callback" there means the callback-caller function > (call_archive_module_shutdown_callback), which in turn is set as a > callback... A callback in a callback in a callback. >> could define the call to before_shmem_exit() a bit earlier because >> that would be a no-op until the library is loaded, but at the end that >> would be just registering a callback that would do nothing useful in a >> larger window, aka until the library is loaded. > > I thought that Bharath's point is to use before_shmem_exit() instead > of PG_ENSURE_ERROR_CLEANUP(). The place doesn't seem significant but > if we use before_shmem_exit(), it would be cleaner to place it > adjecent to on_sheme_exit() call. Removing PG_ENSURE_ERROR_CLEANUP() and relying on before_shmem_exit() is fine by me, that's what I imply upthread. -- Michael
Commits
-
Rework shutdown callback of archiver modules
- 5d2a47a29242 15.1 landed
- 9668c4a6618c 16.0 landed