]> git.ipfire.org Git - thirdparty/postgresql.git/commit
Don't repeatedly register cache callbacks in pgoutput plugin.
authorTom Lane <tgl@sss.pgh.pa.us>
Thu, 23 Feb 2023 20:40:28 +0000 (15:40 -0500)
committerTom Lane <tgl@sss.pgh.pa.us>
Thu, 23 Feb 2023 20:40:28 +0000 (15:40 -0500)
commit95558bc8ff89c5887f1bffc9d152ca603637e2c0
treec671cbc2ea68f1cc13b6c7d6e0b886f5b09ba6fa
parent98b83b7349821b05134e6f50f516ecac878cb91d
Don't repeatedly register cache callbacks in pgoutput plugin.

Multiple cycles of starting up and shutting down the plugin within a
single session would eventually lead to "out of relcache_callback_list
slots", because pgoutput_startup blindly re-registered its cache
callbacks each time.  Fix it to register them only once, as all other
users of cache callbacks already take care to do.

This has been broken all along, so back-patch to all supported branches.

Shi Yu

Discussion: https://postgr.es/m/OSZPR01MB631004A78D743D68921FFAD3FDA79@OSZPR01MB6310.jpnprd01.prod.outlook.com
src/backend/replication/pgoutput/pgoutput.c