Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Postgres logical replication: db table grows indefinitely

I have a postgres table (300Mb size) which is logically replicated to another server. Until I've made some changes everything was perfectly good. Then master started to grow (up to 2,5 Gb at rate 15 mb at 5 minutes roughly). I tried to tune WAL settings and do a WAL cleanup, but it didn't help.

What I have done before this issue was discovered:

  • Rebuilt a materialized view dependent on master table a lot of times (and it is a heavy CPU consuming operation)

  • Added a new column on master table and slave table

  • Added a rule on inserts (copy a value from jsonfield to charfield)

What could have caused this issue?

like image 986
maremare Avatar asked Aug 01 '26 01:08

maremare


1 Answers

I'm still unsure what caused the issue, but probably it was adding a new column. After restoring a backup and recreating publication and subscription everything worked pretty good.

like image 198
maremare Avatar answered Aug 03 '26 21:08

maremare



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!