0

I'am actually working on the logical replication between my master on Windows and slave on Linux. I want to transfer all my datas to my slave with logical replication Postgresql. My postgres on Linuw will be working as docker container.

During the replication, when my container restarted, I have the impression that data were streaming are duplicated, for one table on master with 2,5 Gb of size, I find 5,3 Gb on my slave.

Does it possible that data are duplicated ? There is a way to continue the streaming normally even if docker container restart ?

Thanks a lot

Makina74
  • 45
  • 6

1 Answers1

0

If you have primary keys ore replica identity index on the tables you are replicating then duplication is not possible as logical replication will detect what is called "confict" and it will stop (PGLogical from the other side can manage that but this is a different story).

So if your tables do not have primary keys or replica identity index and you have shapshot mode set to true, your data are going to be inserted again and again every time you remove/add publication or the remove/add tables from publication!

Not sure why you have the impression and you are not sure as you can perform a query with group by in logical/business keys (if you do not have primary keys) using a count(*) to see if your slave data are duplicated.

Stavros Koureas
  • 1,126
  • 12
  • 34