简体   繁体   中英

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?

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM