mirror of
https://github.com/minio/minio.git
synced 2025-11-10 05:59:43 -05:00
Reroute requests based token heal/listing (#9939)
When manual healing is triggered, one node in a cluster will become the authority to heal. mc regularly sends new requests to fetch the status of the ongoing healing process, but a load balancer could land the healing request to a node that is not doing the healing request. This PR will redirect a request to the node based on the node index found described as part of the client token. A similar technique is also used to proxy ListObjectsV2 requests by encoding this information in continuation-token
This commit is contained in:
@@ -33,6 +33,7 @@ type Forwarder struct {
|
||||
RoundTripper http.RoundTripper
|
||||
PassHost bool
|
||||
Logger func(error)
|
||||
ErrorHandler func(http.ResponseWriter, *http.Request, error)
|
||||
|
||||
// internal variables
|
||||
rewriter *headerRewriter
|
||||
@@ -61,6 +62,11 @@ func (f *Forwarder) ServeHTTP(w http.ResponseWriter, inReq *http.Request) {
|
||||
FlushInterval: defaultFlushInterval,
|
||||
ErrorHandler: f.customErrHandler,
|
||||
}
|
||||
|
||||
if f.ErrorHandler != nil {
|
||||
revproxy.ErrorHandler = f.ErrorHandler
|
||||
}
|
||||
|
||||
revproxy.ServeHTTP(w, outReq)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user