Fix status code for GET /replica, when replica is starting (#1152)

Close #772, #1128
This commit is contained in:
anikin-aa
2019-08-26 11:18:13 +02:00
committed by Alexander Kukushkin
parent 53d32f1457
commit 3937a8d4fc
+2 -1
View File
@@ -101,7 +101,8 @@ class RestApiHandler(BaseHTTPRequestHandler):
else:
primary_status_code = 200 if patroni.ha.is_leader() else 503
replica_status_code = 200 if not patroni.noloadbalance and response.get('role') == 'replica' else 503
replica_status_code = 200 if not patroni.noloadbalance and \
response.get('role') == 'replica' and response.get('state') == 'running' else 503
status_code = 503
if patroni.ha.is_standby_cluster() and ('standby_leader' in path or 'standby-leader' in path):