2

I'm currently working with Cloud SQL to store data for my database, which is around 14GB in size. However, over monitoring for the past few weeks, it seems like the storage capacity of the database has been continually increasing. When looking at the size of the WAL logs, it seems as though the logs are the things taking up most of the space select pg_size_pretty(sum(size)) as "Total WAL disk usage" from pg_ls_waldir(); returns 119 GB. What is the best way to resolve this? I have two flags, and have point in time recovery disabled. My database version is PostgreSQL 13.4.

Flag Value
cloudsql.logical_decoding On
cloudsql.enable_pglogical On

I've attempted to run VACUUM FULL; but nothing happened as a result. The latest logs, from running select * from pg_ls_waldir() order by modification Asc; shows logs that exist from the creation of the database (March 13th, well over 7 days ago, which is when I would have expected the logs to purge).

  • 1
    What is receiving the logical replication you have turned on there? It presumably isn't notifying the primary of what it has received. – Richard Huxton Mar 22 '22 at 21:18
  • What does `select * from pg_replication_slots` say? – jjanes Mar 22 '22 at 23:14
  • I'm facing a similar issue. Don't have a logical replication enabled. The setup is a primary + 3 replicas. One of the replicas has WAL size zero as it should be, but two others have it huge. I don't have point in time recovery enabled, but it was enabled before. I disabled it exactly because storage started to grow. – evgeny.myasishchev Jul 06 '23 at 17:41
  • In addition to my comment above, replication slots (on primary) have 3 records (as expected). All are identical. – evgeny.myasishchev Jul 06 '23 at 17:46

0 Answers0