From c064c2b878843a0b12aace9a6fe4b25fd6a97413 Mon Sep 17 00:00:00 2001 From: Wayne Song Date: Mon, 28 Nov 2016 09:23:51 -0800 Subject: [PATCH] Don't forward _ping requests to the primary --- api/replica.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/api/replica.go b/api/replica.go index 990c23d042..2bb8612574 100644 --- a/api/replica.go +++ b/api/replica.go @@ -46,6 +46,13 @@ func (p *Replica) ServeHTTP(w http.ResponseWriter, r *http.Request) { return } + // We also handle /_ping locally, but we do so after the primary + // check above. + if strings.HasSuffix(r.URL.Path, "/_ping") { + w.Write([]byte("OK")) + return + } + if err := hijack(p.tlsConfig, p.primary, w, r); err != nil { httpError(w, fmt.Sprintf("Unable to reach primary cluster manager (%s): %v", err, p.primary), http.StatusInternalServerError) }