diff options
author | John Cai <jcai@gitlab.com> | 2019-11-26 22:34:43 +0300 |
---|---|---|
committer | John Cai <jcai@gitlab.com> | 2019-11-26 22:34:43 +0300 |
commit | 59f4dd3c9a4f7a562849e3bd3d27dce5e0b4551c (patch) | |
tree | 905df77c5b25e392ff5d0300223668e6e0bedede /internal/praefect/server.go | |
parent | 39bfe1dfaa4fcd493d53b21b7a172d0cad2ef8ac (diff) |
Praefect multiple virtual storage
Diffstat (limited to 'internal/praefect/server.go')
-rw-r--r-- | internal/praefect/server.go | 26 |
1 files changed, 15 insertions, 11 deletions
diff --git a/internal/praefect/server.go b/internal/praefect/server.go index ada0d05f6..46ee62cea 100644 --- a/internal/praefect/server.go +++ b/internal/praefect/server.go @@ -37,18 +37,22 @@ type Server struct { } func (srv *Server) warnDupeAddrs(c config.Config) { - addrSet := map[string]struct{}{} - fishy := false - for _, n := range c.Nodes { - _, ok := addrSet[n.Address] - if ok { - srv.l.Warnf("more than one backend node is hosted at %s", n.Address) - fishy = true + var fishy bool + + for _, virtualStorage := range c.VirtualStorages { + addrSet := map[string]struct{}{} + for _, n := range virtualStorage.Nodes { + _, ok := addrSet[n.Address] + if ok { + srv.l.Warnf("more than one backend node is hosted at %s", n.Address) + fishy = true + continue + } + addrSet[n.Address] = struct{}{} + } + if fishy { + srv.l.Warnf("your Praefect configuration may not offer actual redundancy") } - addrSet[n.Address] = struct{}{} - } - if fishy { - srv.l.Warnf("your Praefect configuration may not offer actual redundancy") } } |