Activity: BgwriterHibernate
Waiting in background writer process, hibernating
PostgreSQL wait event dossier
ClassActivity
Event
BgwriterHibernate
VersionsPG 17-18
Evidence4 source location(s)
Official description
Waiting in background writer process, hibernating
| PG 13 | PG 14 | PG 15 | PG 16 | PG 17 | PG 18 |
|---|---|---|---|---|---|
| — | — | — | — | ✓ | ✓ |
Earlier names: Activity/BgWriterHibernate (PG 13-16)
Trigger mechanism
WAIT_EVENT_BGWRITER_HIBERNATE at src/backend/postmaster/bgwriter.c:339 is the grep-verified reporting path. The public identity/resource is mapped at src/backend/utils/activity/wait_event.c:219. The instrumented operation is: Waiting in background writer process, hibernating. The BgwriterHibernate 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/BgwriterHibernate
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/bgwriter.c:339 —
WAIT_EVENT_BGWRITER_HIBERNATE - PostgreSQL 16.15 · src/backend/utils/activity/wait_event.c:219 —
BgWriterHibernate - PostgreSQL 18.6 · src/backend/postmaster/bgwriter.c:337 —
WAIT_EVENT_BGWRITER_HIBERNATE - PostgreSQL 18.6 · src/backend/utils/activity/wait_event_names.txt:56 —
BGWRITER_HIBERNATE
Related controls and signals
- GUCs: None directly.
- Metrics: [metric:waiting_sessions] · [metric:wait_event_share]