Re: Anti-wraparound autovacuum stops for good after no slot available for new autovacuum worker process

From: Sami Imseih <samimseih(dot)pg(at)gmail(dot)com>
To: Colin McDonnell <colinmcd94(at)gmail(dot)com>
Cc: pgsql-bugs(at)lists(dot)postgresql(dot)org
Subject: Re: Anti-wraparound autovacuum stops for good after no slot available for new autovacuum worker process
Date: 2026-12-03 20:48:11
Message-ID: CAN12+YJ_8Vb+1i_j6duFi8+cJT=Q2tBdau-bVoCziBrTzTTLpg@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

Thanks. v4 overall LGTM.

1/

> Separate thing I noticed during testing - in 1 of 6 runs on HEAD with
> autovacuum_worker_slots = 1 and 53 databases, wraparound vacuuming
> paused for 27s. A launcher started 7 ms after the previous worker
> logged the new wrap limit, saw that worker holding the single
> WorkerInfo, and exited without starting a new worker. Looks like the
> race from the 2024 xid_wraparound thread [1] - it resumes at the next
> 65536 XIDs and reproduces without this patch too. Do you think the
> emergency launcher should wait for that worker to exit and retry as
> well, either here or in a separate patch?

Let's leave that a separate patch.

2/

I thought about adding some tests with injection points, not sure if
it's worth it though.

3/

A nit on the 18 patch. The av_launcherpid assignment now sits between the
emergency mode comment and the if:

```
/*
* In emergency mode, just start a worker (unless shutdown was requested)
- * and go away.
+ * and go away once it is running.
*/
+ AutoVacuumShmem->av_launcherpid = MyProcPid;
+
if (!AutoVacuumingActive())
```

Maybe move it before the comment and explain why it's needed.

Sami

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Colin McDonnell 2026-12-03 21:32:02 Re: Anti-wraparound autovacuum stops for good after no slot available for new autovacuum worker process
Previous Message Nathan Bossart 2026-12-03 19:20:23 Re: JSON_SERIALIZE for JSONB returns parts of the internal JSONB representation