RE: [PROPOSAL] Termination of Background Workers for ALTER/DROP DATABASE - Mailing list pgsql-hackers

From Aya Iwata (Fujitsu)
Subject RE: [PROPOSAL] Termination of Background Workers for ALTER/DROP DATABASE
Date
Msg-id OS7PR01MB11964C83E8E543743581250B0EAB3A@OS7PR01MB11964.jpnprd01.prod.outlook.com
Whole thread Raw
In response to Re: [PROPOSAL] Termination of Background Workers for ALTER/DROP DATABASE  (Pavel Stehule <pavel.stehule@gmail.com>)
List pgsql-hackers
Hi

https://www.postgresql.org/message-id/aPBoXXW3XuwiIsHG%40paquier.xyz

Based on previous discussions, we had configured DROP/ALTER DATABASE to
terminate only background workers with specific parameters set.

To reconsider the default behavior, I created the following patches:
0001 is the patch for the existing implementation.
0002 is the patch modified based on Pavel-san's suggestion.

The 0002 patch changes the default behavior to terminate background workers
when DROP/ALTER DATABASE is executed. It also includes a test set
for this change.
For background workers that should not be terminated, setting
the BGWORKER_PROTECTED parameter prevents this.

The relationship with the FORCE option during DROP DATABASE is as follows:

FORCE option present, flag present... TERMINATE
FORCE option present, flag absent... TERMINATE
FORCE option absent, flag present... Does not TERMINATE due to the flag
FORCE option absent, flag absent... TERMINATE

I would like to know your comments on which implementation is preferable.

Regards,
Aya Iwata

Attachment

pgsql-hackers by date:

Previous
From: Xuneng Zhou
Date:
Subject: Re: Implement waiting for wal lsn replay: reloaded
Next
From: Chao Li
Date:
Subject: Re: Fix incorrect assertion in heapgettup_pagemode()