Re: "out of relcache_callback_list slots" after multiple calls to pg_logical_slot_get_binary_changes - Mailing list pgsql-hackers

From Peter Smith
Subject Re: "out of relcache_callback_list slots" after multiple calls to pg_logical_slot_get_binary_changes
Date
Msg-id CAHut+PsM_KJKFZPMhA=EdoLC+KY=8MSQpG2-R-v3-psUx813uQ@mail.gmail.com
Whole thread Raw
In response to Re: "out of relcache_callback_list slots" after multiple calls to pg_logical_slot_get_binary_changes  (Kyotaro Horiguchi <horikyota.ntt@gmail.com>)
Responses Re: "out of relcache_callback_list slots" after multiple calls to pg_logical_slot_get_binary_changes
List pgsql-hackers
On Wed, Feb 22, 2023 at 12:03 PM Kyotaro Horiguchi
<horikyota.ntt@gmail.com> wrote:
>
> At Tue, 21 Feb 2023 10:31:29 +0000, "shiy.fnst@fujitsu.com" <shiy.fnst@fujitsu.com> wrote in
> > Thanks for your reply. I agree that's expensive. Attach a new patch which adds a
> > static boolean to avoid duplicate registration.
>
> Thank you for the patch.  It is exactly what I had in my mind. But now
> that I've had a chance to mull it over, I came to think it might be
> better to register the callbacks at one place. I'm thinking we could
> create a new function called register_callbacks() or something and
> move all the calls to CacheRegisterSyscacheCallback() into that. What
> do you think about that refactoring?
>
> I guess you could say that that refactoring somewhat weakens the
> connection or dependency between init_rel_sync_cache and
> rel_sync_cache_relation_cb, but anyway the callback works even if
> RelationSyncCache is not around.
>

If you are going to do that, then won't just copying the
CacheRegisterSyscacheCallback(PUBLICATIONOID...  into function
init_rel_sync_cache() be effectively the same as doing that?

Then almost nothing else to do...e.g. no need for a new extra static
boolean if static RelationSyncCache is acting as the one-time guard
anyway.

------
Kind Regards,
Peter Smith.
Fujitsu Australia



pgsql-hackers by date:

Previous
From: Kyotaro Horiguchi
Date:
Subject: Re: "out of relcache_callback_list slots" after multiple calls to pg_logical_slot_get_binary_changes
Next
From: David Rowley
Date:
Subject: Re: Reducing System Allocator Thrashing of ExecutorState to Alleviate FDW-related Performance Degradations