Re: [PROPOSAL] Termination of Background Workers for ALTER/DROP DATABASE
| От | Pavel Stehule |
|---|---|
| Тема | Re: [PROPOSAL] Termination of Background Workers for ALTER/DROP DATABASE |
| Дата | |
| Msg-id | CAFj8pRB_FH-Pcth9XFcpY2OTasVOP-2DfYOsVxL38igw0O4hdg@mail.gmail.com обсуждение исходный текст |
| Ответ на | Re: [PROPOSAL] Termination of Background Workers for ALTER/DROP DATABASE (Michael Paquier <michael@paquier.xyz>) |
| Ответы |
RE: [PROPOSAL] Termination of Background Workers for ALTER/DROP DATABASE
|
| Список | pgsql-hackers |
Hi
ne 14. 12. 2025 v 8:26 odesílatel Michael Paquier <michael@paquier.xyz> napsal:
On Wed, Oct 15, 2025 at 02:48:43AM +0000, Aya Iwata (Fujitsu) wrote:
> Thank you for your comments. I updated this patch to v0007.
+ * Exit the bgworker when its database is dropped, renamed, moved to a
+ * different tablespace, or used as a template for CREATE DATABASE.
I don't think that we need to list all these operations in details
here. We could just say "if its database is involved in a CREATE,
ALTER or DROP database command". The docs should provide these
details, of course.
+#define BGWORKER_EXIT_AT_DATABASE_CHANGE 0x0004
BGWORKER_EXIT_AT_DATABASE_CHANGE - it is used for disconnecting workers on the template database, and this database is not changing.
TerminateBgWorkersByDbOid - it doesn't terminate all workers, but only workers with some special flags
Maybe BGWORKER_INTERRUPTABLE and TerminateInterruptableBgWorkersByDbOid ?
Another question is if this cancellation should be implicit and should not require some special flag.
When I want to disconnect connections to database when I do drop, I have to use FORCE flag
So maybe there should be ALTER DATABASE ... RENAME ... FORCE - or if FORCE can terminare all workers (without special FLAG) ?
Regards
Pavel
В списке pgsql-hackers по дате отправления: