LWLock: XactSLRU
Waiting to access the transaction status SLRU cache
PostgreSQL wait event dossier
ClassLWLock
Event
XactSLRU
VersionsPG 13-18
Evidence3 source location(s)
Official description
Waiting to access the transaction status SLRU cache
| PG 13 | PG 14 | PG 15 | PG 16 | PG 17 | PG 18 |
|---|---|---|---|---|---|
| ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
Trigger mechanism
The transaction-status SLRU lock protects pg_xact cache metadata and pages while PostgreSQL reads or updates transaction commit status. Visibility checks for uncached or old XIDs can bring this path into the foreground.
Normal or trouble?
- Normal: Short waits accompany transaction completion and occasional pg_xact cache misses.
- Investigate: Persistent waits can indicate transaction-status cache churn, access to very old tuples, or storage latency on the pg_xact path.
Diagnostic SQL
Sessions waiting on LWLock/XactSLRU
Current LWLock cohort
Lock and relation context for these sessions
Response
- Check old transactions and vacuum/freeze health.
- Correlate with XactBuffer and pg_xact I/O waits.
- Remove visibility-horizon blockers and restore vacuum progress before changing SLRU-related capacity.
Source evidence
- PostgreSQL 18.6 · src/backend/storage/lmgr/lwlock.c:178 —
XactSLRU - PostgreSQL 18.6 · src/backend/storage/lmgr/lwlock.c:739 —
pgstat_report_wait_start - PostgreSQL 18.6 · src/backend/utils/activity/wait_event_names.txt:403 —
XactSLRU
Related controls and signals
- GUCs: [guc:autovacuum_freeze_max_age] · [guc:vacuum_freeze_table_age]
- Metrics: [metric:waiting_sessions] · [metric:wait_event_share] · [metric:oldest_transaction_age] · [metric:xact_slru_io]
Typical incident pattern
A long-lived snapshot prevents cleanup while queries revisit cold, old tuple versions, creating pg_xact cache churn and XactSLRU contention.