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

From Michael Paquier
Subject Re: [PROPOSAL] Termination of Background Workers for ALTER/DROP DATABASE
Date
Msg-id acun5kN_JaLFcfq_@paquier.xyz
Whole thread Raw
In response to Re: [PROPOSAL] Termination of Background Workers for ALTER/DROP DATABASE  (Alexander Lakhin <exclusion@gmail.com>)
Responses Re: [PROPOSAL] Termination of Background Workers for ALTER/DROP DATABASE
List pgsql-hackers
On Tue, Mar 31, 2026 at 10:00:00AM +0300, Alexander Lakhin wrote:
> So the backend is not completely stuck, but CommitTransactionCommand()
> may take more than 5 seconds under some circumstances (maybe it's worth
> investigating which exactly).

One could blame slow hardware, difficult to say, and I'm puzzled by
these periodic bumps that don't seem to happen elsewhere.  There is at
least one alternative that I can think here to make the test more
stable and make sure that worker_spi reaches its main loop before
attempting the database commands.  We could add a wait_for_event() at
the end of launch_bgworker() based on WorkerSpiMain, and enlarge
worker_spi_naptime to an insanely larger value, to make sure that we
remain on the WaitLatch() until the worker is interrupted and that we
don't attempt a new transaction.
--
Michael

Attachment

pgsql-hackers by date:

Previous
From: Amit Kapila
Date:
Subject: Re: Adding REPACK [concurrently]
Next
From: Junwang Zhao
Date:
Subject: Re: Eliminating SPI / SQL from some RI triggers - take 3