Re: [PROPOSAL] Termination of Background Workers for ALTER/DROP DATABASE

From: Michael Paquier <michael(at)paquier(dot)xyz>
To: Peter Smith <smithpb2250(at)gmail(dot)com>
Cc: "Aya Iwata (Fujitsu)" <iwata(dot)aya(at)fujitsu(dot)com>, Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>, Chao Li <li(dot)evan(dot)chao(at)gmail(dot)com>, "Hayato Kuroda (Fujitsu)" <kuroda(dot)hayato(at)fujitsu(dot)com>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: [PROPOSAL] Termination of Background Workers for ALTER/DROP DATABASE
Date: 2026-01-06 05:38:06
Message-ID: aVyfvgMplnc6aIE2@paquier.xyz
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Tue, Jan 06, 2026 at 08:18:39AM +1100, Peter Smith wrote:
> This did not seem like the correct fix for my previous review comment
> [1, comment #3], because the autovacuum backends are still killed with
> SIGTERM, right?

Yes, you are right that this creates a confusing mix. Bgworkers have
no relationship with SIGTERM in this code. I have added a sentence to
document the new behavior for interruptible bgworkers, after the
existing ones. One thing that was also missing is the fact that the
wait can be shortened with the injection point.

> 2.
> +# Confirm that the non-interruptible bgworker is still running.
> +my $result = $node->safe_psql(
> + "postgres", qq(
> + SELECT count(1) FROM pg_stat_activity
> + WHERE backend_type = 'worker_spi dynamic';));
>
> The indentation of the "SELECT" still does not look correct to me. Did
> you run pgperltidy on this file?

perltidy is happy with that, because it considers the string within
the quoted qq() area as something fine. At the end this is just a tab
vs whitespace issue, you are right that this should use whitespaces.

I have done a couple of test runs in the CI to be sure, and noticed no
instability in the tests, so applied. I'll keep an eye on the CFbot
and the buildfarm for the next few days.
--
Michael

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Fujii Masao 2026-01-06 05:41:16 Re: [PATCH] Expose checkpoint reason to completion log messages.
Previous Message David Rowley 2026-01-06 04:34:11 Re: Avoid corrupting DefElem nodes when parsing publication_names and publish options