Partman on Cluster (Master with Slaves) #566
-
Hi everyone! I cant find any information on how to configure partman on postgres cluster. How to configure it properly? I think slave shoud not do any maintenance, and just sync all changes from master. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
Replicas cannot write to the database, so it's not possible for them to create child tables before the master. All newly created tables on the primary will automatically replicate. So just do the same config on all nodes in the cluster and you should be fine. But, you know, it looks like I never did add replica detection to the maintenance function. Can't believe I've missed that all this time. All this means is that if maintenance runs on the replica before the primary, it'll throw an error that it can't write. I can code it to fail gracefully if it's run on a replica, though. Thanks for bringing this up! |
Beta Was this translation helpful? Give feedback.
Replicas cannot write to the database, so it's not possible for them to create child tables before the master. All newly created tables on the primary will automatically replicate. So just do the same config on all nodes in the cluster and you should be fine.
But, you know, it looks like I never did add replica detection to the maintenance function. Can't believe I've missed that all this time. All this means is that if maintenance runs on the replica before the primary, it'll throw an error that it can't write. I can code it to fail gracefully if it's run on a replica, though. Thanks for bringing this up!