public inbox for [email protected]
help / color / mirror / Atom feedFrom: Pavel Stehule <[email protected]>
To: Aya Iwata (Fujitsu) <[email protected]>
Cc: Michael Paquier <[email protected]>
Cc: Peter Smith <[email protected]>
Cc: Chao Li <[email protected]>
Cc: Hayato Kuroda (Fujitsu) <[email protected]>
Cc: pgsql-hackers <[email protected]>
Subject: Re: [PROPOSAL] Termination of Background Workers for ALTER/DROP DATABASE
Date: Mon, 15 Dec 2025 14:18:19 +0100
Message-ID: <CAFj8pRCRnN4SyZDPbQwTyKZ_kVHfwLG6udCXsXDTG_z9fWwYQg@mail.gmail.com> (raw)
In-Reply-To: <OS7PR01MB119647141272DBF9364A1C5AAEAADA@OS7PR01MB11964.jpnprd01.prod.outlook.com>
References: <[email protected]>
<OSCPR01MB1496614832F8014EC16FB78D2F5EEA@OSCPR01MB14966.jpnprd01.prod.outlook.com>
<[email protected]>
<OSCPR01MB14966EC12277712131EB8EDF1F5EEA@OSCPR01MB14966.jpnprd01.prod.outlook.com>
<OS7PR01MB11964C8FE9CDCC0F4C9110988EAEEA@OS7PR01MB11964.jpnprd01.prod.outlook.com>
<[email protected]>
<OS7PR01MB11964C077A3E61F4887DD3D09EAEFA@OS7PR01MB11964.jpnprd01.prod.outlook.com>
<CAHut+PtbOP_80OPZXCUZO=-pBJSRTmHcQ2MnVTFov1meNbw18Q@mail.gmail.com>
<CAHut+Pt5BN0LDh7OzbNqh9+zqHBgsrLX+vh-gn+3FKYTFHMvhw@mail.gmail.com>
<TY3PR01MB11969CBD6DF3E0DB820AD4262EAE8A@TY3PR01MB11969.jpnprd01.prod.outlook.com>
<[email protected]>
<CAFj8pRB_FH-Pcth9XFcpY2OTasVOP-2DfYOsVxL38igw0O4hdg@mail.gmail.com>
<OS7PR01MB119647141272DBF9364A1C5AAEAADA@OS7PR01MB11964.jpnprd01.prod.outlook.com>
po 15. 12. 2025 v 13:56 odesílatel Aya Iwata (Fujitsu) <
[email protected]> napsal:
> Hi
>
> Thank you for your review.
>
> > From: Pavel Stehule <[email protected]>
> > Sent: Sunday, December 14, 2025 4:40 PM
> > To: Michael Paquier <[email protected]>
> > Cc: Iwata, Aya/岩田 彩 <[email protected]>; Peter Smith <
> [email protected]>; Chao Li <[email protected]>; Kuroda,
> Hayato/黒田 隼人 <[email protected]>; pgsql-hackers <
> [email protected]>
> > Subject: Re: [PROPOSAL] Termination of Background Workers for ALTER/DROP
> DATABASE
> >
> > +#define BGWORKER_EXIT_AT_DATABASE_CHANGE 0x0004
> >
> > I am checking this patch, and I think so used names can be little bit
> confusing
> >
> > 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 ?
>
> Thank you for your advice.
> I changed the name of a function and a flag.
>
> > 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) ?
>
> For the proposed feature, we've added a flag allowing each extension
> developer to decide whether to terminate it via DROP/ALTER DATABASE.
> Adding a FORCE option to ALTER to let database definition modifiers decide
> whether to force termination of background workers might be better
> discussed in a separate thread.
>
When I thought about it - there can be a second alternative.
Introduce a pair of flags BGWORKER_INTERRUPTABLE and BGWORKER_PROTECTED
(the names can be enhanced or changed). BGWORKER_INTERRUPTABLE can be
default.
ALTER DATABASE RENAME and related commands can stop any non protected
workers. ALTER DATABASE RENAME FORCE can stop any workers (including
protected).
Is there any reason why BGWORKER_INTERRUPTABLE cannot be default? Probably
nobody would block some possibly common operations on database level
without strong reason.
Regards
Pavel
> Best Regards,
> Aya Iwata
>
view thread (67+ messages) latest in thread
reply
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: [email protected]
Cc: [email protected], [email protected], [email protected], [email protected], [email protected], [email protected]
Subject: Re: [PROPOSAL] Termination of Background Workers for ALTER/DROP DATABASE
In-Reply-To: <CAFj8pRCRnN4SyZDPbQwTyKZ_kVHfwLG6udCXsXDTG_z9fWwYQg@mail.gmail.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox