Implement '/sync' and /async endpoints (#578)

They will respond with http status code 200 only when the node is running as a synchronous or asynchronous replica.

Fixes https://github.com/zalando/patroni/issues/189
Fixes https://github.com/zalando/patroni/issues/415
This commit is contained in:
Alexander Kukushkin
2018-01-05 15:28:40 +01:00
committed by GitHub
parent 03c2a85d23
commit 5668367181
3 changed files with 24 additions and 1 deletions
+5
View File
@@ -19,6 +19,11 @@ Feature: basic replication
And I run patronictl.py restart batman postgres1 --force
Then I receive a response returncode 0
And "sync" key in DCS has sync_standby=postgres2 after 10 seconds
And I sleep for 2 seconds
When I issue a GET request to http://127.0.0.1:8010/sync
Then I receive a response code 200
When I issue a GET request to http://127.0.0.1:8009/async
Then I receive a response code 200
Scenario: check the basic failover in synchronous mode
Given I run patronictl.py pause batman