2ndQuadrant / pglogical

Logical Replication extension for PostgreSQL 15, 14, 13, 12, 11, 10, 9.6, 9.5, 9.4 (Postgres), providing much faster replication than Slony, Bucardo or Londiste, as well as cross-version upgrades.

Home Page:http://2ndquadrant.com/en/resources/pglogical/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Unable to drop a database when pglogical is in preload_shared_libraries

j0r0 opened this issue · comments

Hi,
Seems that i can't drop any dayabase when pglogical is enabled as shared library on Postgrs 15.
This is what i see in the log:

2023-03-10 10:32:59.671 UTC [50756] root@postgres LOG: still waiting for backend with PID 50728 to accept ProcSignalBarrier 2023-03-10 10:32:59.671 UTC [50756] root@postgres STATEMENT: drop database MY_DB

The drop database just hangs forever.

The pglogical extension is not event created. It just enabled in the shared_preload_libraries.

If i remove it from the shared prefload libs, drop database works.

same problem here with pglogical-2.4.2 and postgresql-15.2

used to work with PG-14, now is broken with PG-15

the PID in ... still waiting for backend with PID ... is referring to the pglogical supervisor process

the problem appears to be related to:

this test confirms that if pglogical supervisor process is removed, the drop starts to work:

SELECT pg_terminate_backend(pid, 3000) 
FROM pg_stat_activity
WHERE  backend_type = 'pglogical supervisor' ;
DROP DATABASE IF EXISTS "tester_table" ;

the issue with pglogical supervisor is resolved when pglogical is built from source upto this commit:
f27d3c4

but similar deadlock still happens although more sporadically when drop is blocked now by pglogical apply process

@eulerto Euler: can you please take a look and see if #403 is sufficient? thank you.