Skip to content

cleanup old WAL segments when the WAL PVC utilization reaches more than 90%#702

Open
boddumanohar wants to merge 1 commit intodevfrom
wal-compact
Open

cleanup old WAL segments when the WAL PVC utilization reaches more than 90%#702
boddumanohar wants to merge 1 commit intodevfrom
wal-compact

Conversation

@boddumanohar
Copy link
Copy Markdown
Member

@boddumanohar boddumanohar commented Mar 27, 2026

fixes: simplyblock/vela#257

cleanup old WAL segments when the WAL PVC utilization reaches more than 90%.

A periodic celery beat task that checks the utilisation of WAL and trigger the wal_cleanup task.

the task gets the Safe WAL checkpoint

SELECT pg_walfile_name(redo_lsn) FROM pg_control_checkpoint();

and cleanup the WAL files older than this by running

pg_archivecleanup /mnt/postgres_wal/wal $SAFE_WAL

@boddumanohar boddumanohar force-pushed the wal-compact branch 2 times, most recently from 2a4d3af to f63af6d Compare March 30, 2026 15:34
@boddumanohar boddumanohar changed the title api to cleanup old wal segments cleanup old WAL segments when the WAL PVC utilization reaches more than 90% Mar 31, 2026
@boddumanohar boddumanohar marked this pull request as ready for review March 31, 2026 06:45
@boddumanohar boddumanohar requested a review from mxsrc March 31, 2026 07:20
@boddumanohar boddumanohar mentioned this pull request Apr 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant