You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In PG15 + pg_cron,
when there is a scheduled active cron job, the client is unable to successfully drop any databases, even the ones on which there are no cron jobs.
postgres=# CREATE DATABASE testdb;
CREATE DATABASE
postgres=# SELECT cron.schedule('59 seconds', $$SELECT pg_sleep(5)$$);
schedule
----------
5
(1 row)
postgres=# DROP DATABASE testdb;
^CCancel request sent
ERROR: canceling statement due to user request
When there is at least one active cron job, running DROP DATABASE testdb and canceling as above puts the target testdb into an invalid state.
postgres=# \c testdb;
connection to server on socket "/tmp/.s.PGSQL.5432" failed: FATAL: cannot connect to invalid database "testdb"
HINT: Use DROP DATABASE to drop invalid databases.
Previous connection kept
It seems DROP DATABASE deadlocks with bgworker running in pg_cron. I see the following server log when DROP DATABASE is blocked:
still waiting for backend with PID 93345 to accept ProcSignalBarrier
where the backend with the mentioned PID is the background worker running pg_cron.c:PgCronLauncherMain.
In PG15 + pg_cron,
when there is a scheduled active cron job, the client is unable to successfully drop any databases, even the ones on which there are no cron jobs.
When there is at least one active cron job, running
DROP DATABASE testdb
and canceling as above puts the targettestdb
into an invalid state.It seems
DROP DATABASE
deadlocks with bgworker running inpg_cron
. I see the following server log whenDROP DATABASE
is blocked:where the backend with the mentioned PID is the background worker running pg_cron.c:PgCronLauncherMain.
An issue with similar symptoms existed and was fixed in Timescale (timescale/timescaledb#4838)
Similar issue exists in 2ndQuadrant/pglogical#418
it seems calling
CHECK_FOR_INTERRUPTS()
in the main PgCronLauncher loop fixes the issueThe text was updated successfully, but these errors were encountered: