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

2023-02-23 Thread Tom Lane
Peter Smith writes: > Should the 'relation_callback_registered' variable name be plural? Yeah, plural seems better to me too. I fixed that and did a little comment-editing and pushed it. regards, tom lane

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

2023-02-22 Thread Peter Smith
On Thu, Feb 23, 2023 at 11:28 AM Michael Paquier wrote: > > On Wed, Feb 22, 2023 at 10:21:51AM +, shiy.f...@fujitsu.com wrote: > > Thanks for your reply. Using two flags makes sense to me. > > Attach the updated patch. > > Fine by me as far as it goes. Any thoughts from others? > -- Should

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

2023-02-22 Thread Michael Paquier
On Wed, Feb 22, 2023 at 10:21:51AM +, shiy.f...@fujitsu.com wrote: > Thanks for your reply. Using two flags makes sense to me. > Attach the updated patch. Fine by me as far as it goes. Any thoughts from others? -- Michael signature.asc Description: PGP signature

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

2023-02-22 Thread shiy.f...@fujitsu.com
On Wed, Feb 22, 2023 2:20 PM Michael Paquier wrote: > > On Wed, Feb 22, 2023 at 12:07:06PM +0900, Kyotaro Horiguchi wrote: > > At Wed, 22 Feb 2023 12:29:59 +1100, Peter Smith > wrote in > >> If you are going to do that, then won't just copying the > >>

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

2023-02-21 Thread Michael Paquier
On Wed, Feb 22, 2023 at 12:07:06PM +0900, Kyotaro Horiguchi wrote: > At Wed, 22 Feb 2023 12:29:59 +1100, Peter Smith wrote > in >> If you are going to do that, then won't just copying the >> CacheRegisterSyscacheCallback(PUBLICATIONOID... into function >> init_rel_sync_cache() be effectively

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

2023-02-21 Thread Kyotaro Horiguchi
Thanks for the comment. At Wed, 22 Feb 2023 12:29:59 +1100, Peter Smith wrote in > On Wed, Feb 22, 2023 at 12:03 PM Kyotaro Horiguchi > wrote: > > > > At Tue, 21 Feb 2023 10:31:29 +, "shiy.f...@fujitsu.com" > > wrote in > > > Thanks for your reply. I agree that's expensive. Attach a new

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

2023-02-21 Thread Peter Smith
On Wed, Feb 22, 2023 at 12:03 PM Kyotaro Horiguchi wrote: > > At Tue, 21 Feb 2023 10:31:29 +, "shiy.f...@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

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

2023-02-21 Thread Kyotaro Horiguchi
At Tue, 21 Feb 2023 10:31:29 +, "shiy.f...@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

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

2023-02-21 Thread shiy.f...@fujitsu.com
On Mon, Feb 20, 2023 11:31 PM Tom Lane wrote: > > Kyotaro Horiguchi 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 >

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

2023-02-20 Thread Tom Lane
Kyotaro Horiguchi 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

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

2023-02-20 Thread Kyotaro Horiguchi
Good catch! At Sun, 19 Feb 2023 02:40:31 +, "shiy.f...@fujitsu.com" wrote in > init_rel_sync_cache()), but they are not unregistered when it shutdowns. So, > after multiple calls to the function, MAX_RELCACHE_CALLBACKS is exceeded. This > is mentioned in the following comment. > >

"out of relcache_callback_list slots" after multiple calls to pg_logical_slot_get_binary_changes

2023-02-18 Thread shiy.f...@fujitsu.com
Hi hackers, After multiple calls to the function pg_logical_slot_get_binary_changes() in single client backend (the output plugin of the slot is pgoutput), I got the following error: client backend FATAL: out of relcache_callback_list slots client backend CONTEXT: slot "testslot", output