Re: "out of relcache_callback_list slots" after multiple calls to pg_logical_slot_get_binary_changes

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Kyotaro Horiguchi <horikyota(dot)ntt(at)gmail(dot)com>
Cc: shiy(dot)fnst(at)fujitsu(dot)com, pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Re: "out of relcache_callback_list slots" after multiple calls to pg_logical_slot_get_binary_changes
Date: 2023-02-20 15:30:43
Message-ID: 3569225.1676907043@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Kyotaro Horiguchi <horikyota(dot)ntt(at)gmail(dot)com> writes:
> I'm pretty sure that everytime an output plugin is initialized on a
> process, it installs the same set of syscache/relcache callbacks each
> time. Do you think we could simply stop duplicate registration of
> those callbacks by using a static boolean? It would be far simpler.

Yeah, I think that's the way it's done elsewhere. Removing and
re-registering your callback seems expensive, and it also destroys
any reasoning that anyone might have made about the order in which
different callbacks will get called. (Admittedly, that's probably not
important for invalidation callbacks, but it does matter for e.g.
process exit callbacks.)

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2023-02-20 15:40:10 Re: ExecRTCheckPerms() and many prunable partitions (checkAsUser)
Previous Message Aleksander Alekseev 2023-02-20 15:30:31 Re: XID formatting and SLRU refactorings (was: Add 64-bit XIDs into PostgreSQL 15)