(action string, primaryURLs ...string)
| 235 | } |
| 236 | |
| 237 | func (p *proxy) joinCluster(action string, primaryURLs ...string) (status int, err error) { |
| 238 | var query url.Values |
| 239 | if smap := p.owner.smap.get(); smap.isPrimary(p.si) { |
| 240 | return 0, fmt.Errorf("%s should not be joining: is primary, %s", p, smap.StringEx()) |
| 241 | } |
| 242 | if cmn.GCO.Get().Proxy.NonElectable { |
| 243 | query = url.Values{apc.QparamNonElectable: []string{"true"}} |
| 244 | } |
| 245 | res := p.join(query, primaryURLs...) |
| 246 | defer freeCR(res) |
| 247 | if res.err != nil { |
| 248 | status, err = res.status, res.err |
| 249 | return |
| 250 | } |
| 251 | // not being sent at cluster startup and keepalive |
| 252 | if len(res.bytes) == 0 { |
| 253 | return |
| 254 | } |
| 255 | err = p.recvCluMetaBytes(action, res.bytes, "") |
| 256 | return |
| 257 | } |
| 258 | |
| 259 | func (p *proxy) recvCluMetaBytes(action string, body []byte, caller string) error { |
| 260 | var cm cluMeta |
no test coverage detected