Search Postgresql Archives

Replication with Patroni not working after killing secondary and starting again

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,
I am new to Patroni and PostgreSQL.We have set up a cluster with etcd (3 nodes), Patroni (2 nodes) and PostgreSQL (2 nodes) with replication from primary to secondary. Seemed to be working fine and we started some tests. One of the tests gave us unsatisfactory results. Specifically when we start a long transaction with multiple inserts (we use remote Java app for that) and during execution of this transaction we kill the secondary database by using the following:
first list the processes:
ps aux | egrep '(patroni|postgresql)'
and
uses the kill -9 command for the two processes that have postgres in the name then the following happens:

1) Java app continues with the long transaction which is OK
2) Patroni is not restarting automatically again on the secondary, which I assume is as expected (?)
3) When the transaction finishes and we start the patroni on secondary by using the commands:
systemctl enable patroni
systemctl start patroni

 the database starts on secondary after a while but the replication from the primary is not working anymore. Trying new transactions does not replicate the data either. The same set up worked before in other scenarios - replicated data (e.g. when using short transactions, killing the secondary, restarting secondary).

Thus my questions:
1) Is it normal that replication stops working if we kill secondary postgres and start it again using patroni? Do we need to do any additional steps except the commands above that start patroni?
2) Is it normal that patroni is not started again automatically after we kill it and postgres on secondary?
3) Or there is something wrong with our setup and the replication should be recovered automatically after we kill the secondary and start the patroni again on secondary?

Thanks,

Zbigniew


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]

  Powered by Linux