Re: fix archive module shutdown callback

2022-10-18 Thread Michael Paquier
On Tue, Oct 18, 2022 at 02:38:07PM +0530, Bharath Rupireddy wrote: > 2) Clarifies when the archive module shutdown callback gets called in > documentation. I have looked at that, and it was actually confusing as the callback would also be called on reload if archive_library changes, but the update

Re: fix archive module shutdown callback

2022-10-18 Thread Bharath Rupireddy
On Mon, Oct 17, 2022 at 11:17 AM Michael Paquier wrote: > > On Mon, Oct 17, 2022 at 02:30:52PM +0900, Kyotaro Horiguchi wrote: > > Removing PG_ENSURE_ERROR_CLEANUP() and relying on before_shmem_exit() > is fine by me, that's what I imply upthread. Hm. Here's a v2 patch that addresses review comme

Re: fix archive module shutdown callback

2022-10-16 Thread Michael Paquier
On Mon, Oct 17, 2022 at 02:30:52PM +0900, Kyotaro Horiguchi wrote: > At Mon, 17 Oct 2022 13:51:52 +0900, Michael Paquier > 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_lib

Re: fix archive module shutdown callback

2022-10-16 Thread Kyotaro Horiguchi
At Sun, 16 Oct 2022 13:39:14 +0530, Bharath Rupireddy wrote in > On Sun, Oct 16, 2022 at 3:43 AM Nathan Bossart > wrote: > > > > Hi hackers, > > > > Presently, when an archive module sets up a shutdown callback, it will be > > called upon ERROR/FATAL (via PG_ENSURE_ERROR_CLEANUP), when the arc

Re: fix archive module shutdown callback

2022-10-16 Thread Kyotaro Horiguchi
At Mon, 17 Oct 2022 13:51:52 +0900, Michael Paquier wrote in > On Sun, Oct 16, 2022 at 01:39:14PM +0530, Bharath Rupireddy wrote: > > Is the shutdown callback meant to be called only after the archive > > library is loaded? The documentation [1] says that it just gets called > > before the archi

Re: fix archive module shutdown callback

2022-10-16 Thread Michael Paquier
On Sun, Oct 16, 2022 at 01:39:14PM +0530, Bharath Rupireddy wrote: > Is the shutdown callback meant to be called only after the archive > library is loaded? The documentation [1] says that it just gets called > before the archiver process exits. If this is true, can we just place > before_shmem_exi

Re: fix archive module shutdown callback

2022-10-16 Thread Bharath Rupireddy
On Sun, Oct 16, 2022 at 3:43 AM Nathan Bossart wrote: > > Hi hackers, > > Presently, when an archive module sets up a shutdown callback, it will be > called upon ERROR/FATAL (via PG_ENSURE_ERROR_CLEANUP), when the archive > library changes (via HandlePgArchInterrupts()), and upon normal shutdown.

fix archive module shutdown callback

2022-10-15 Thread Nathan Bossart
Hi hackers, Presently, when an archive module sets up a shutdown callback, it will be called upon ERROR/FATAL (via PG_ENSURE_ERROR_CLEANUP), when the archive library changes (via HandlePgArchInterrupts()), and upon normal shutdown. There are a couple of problems with this: * HandlePgArchInterrupt