Re: fix archive module shutdown callback

From: Michael Paquier <michael(at)paquier(dot)xyz>
To: Kyotaro Horiguchi <horikyota(dot)ntt(at)gmail(dot)com>
Cc: bharath(dot)rupireddyforpostgres(at)gmail(dot)com, nathandbossart(at)gmail(dot)com, pgsql-hackers(at)postgresql(dot)org
Subject: Re: fix archive module shutdown callback
Date: 2022-10-17 05:47:15
Message-ID: Y0zsYxlcwhNjDMWF@paquier.xyz
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
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(at)paquier(dot)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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message wangw.fnst@fujitsu.com 2022-10-17 05:49:23 RE: Data is copied twice when specifying both child and parent table in publication
Previous Message Kyotaro Horiguchi 2022-10-17 05:30:57 Re: fix archive module shutdown callback