mirror of
https://github.com/outbackdingo/patroni.git
synced 2026-08-25 14:53:37 +00:00
Fix status code for GET /replica, when replica is starting (#1152)
Close #772, #1128
This commit is contained in:
committed by
Alexander Kukushkin
parent
53d32f1457
commit
3937a8d4fc
+2
-1
@@ -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):
|
||||
|
||||
Reference in New Issue
Block a user