Activity: AutovacuumMain
Waiting in main loop of autovacuum launcher process
PostgreSQL wait event dossier
ClassActivity
Event
AutovacuumMain
VersionsPG 17-18
Evidence4 source location(s)
Official description
Waiting in main loop of autovacuum launcher process
| PG 13 | PG 14 | PG 15 | PG 16 | PG 17 | PG 18 |
|---|---|---|---|---|---|
| — | — | — | — | ✓ | ✓ |
Earlier names: Activity/AutoVacuumMain (PG 13-16)
Trigger mechanism
WAIT_EVENT_AUTOVACUUM_MAIN at src/backend/postmaster/autovacuum.c:667 is the grep-verified reporting path. The public identity/resource is mapped at src/backend/utils/activity/wait_event.c:216. The instrumented operation is: Waiting in main loop of autovacuum launcher process. The AutovacuumMain background path reports this event around its latch wait when its main loop has no immediate work. A signal, timeout, or new work clears the sleep and the process loops again.
Normal or trouble?
- Normal: This is normally expected idleness for the matching background process.
- Investigate: Investigate only when queued work or a shutdown/failover deadline is not advancing while the process remains here, or when the event appears on an unexpected backend type.
Diagnostic SQL
Sessions waiting on Activity/AutovacuumMain
Current Activity cohort
Lock and relation context for these sessions
Response
- Match the row to backend_type.
- Inspect the process-specific backlog and last-progress timestamp.
- Fix the missing work signal or stalled upstream phase; do not kill a normally idle worker.
Source evidence
- PostgreSQL 16.15 · src/backend/postmaster/autovacuum.c:667 —
WAIT_EVENT_AUTOVACUUM_MAIN - PostgreSQL 16.15 · src/backend/utils/activity/wait_event.c:216 —
AutoVacuumMain - PostgreSQL 18.6 · src/backend/postmaster/autovacuum.c:595 —
WAIT_EVENT_AUTOVACUUM_MAIN - PostgreSQL 18.6 · src/backend/utils/activity/wait_event_names.txt:55 —
AUTOVACUUM_MAIN
Related controls and signals
- GUCs: [guc:autovacuum_naptime]
- Metrics: [metric:waiting_sessions] · [metric:wait_event_share] · [metric:oldest_transaction_age]