fix: all hosts local and port same should be local erasure setup (#10951)

this is needed to avoid initializing notification peers
that can lead to races in many sub-systems

fixes #10950
This commit is contained in:
Harshavardhana
2020-11-23 09:07:50 -08:00
committed by GitHub
parent df93102235
commit 734d07a532
3 changed files with 10 additions and 10 deletions

View File

@@ -689,14 +689,14 @@ func CreateEndpoints(serverAddr string, foundLocal bool, args ...[]string) (Endp
// All endpoints are pointing to local host
if len(endpoints) == localEndpointCount {
// If all endpoints have same port number, Just treat it as distErasure setup
// If all endpoints have same port number, Just treat it as local erasure setup
// using URL style endpoints.
if len(localPortSet) == 1 {
if len(localServerHostSet) > 1 {
return endpoints, setupType,
config.ErrInvalidErasureEndpoints(nil).Msg("all local endpoints should not have different hostnames/ips")
}
return endpoints, DistErasureSetupType, nil
return endpoints, ErasureSetupType, nil
}
// Even though all endpoints are local, but those endpoints use different ports.