forked from TrueCloudLab/frostfs-node
[#872] cmd/neofs-node: Don't lose local container size estimations
Signed-off-by: Alex Vanin <alexey@nspcc.ru>
This commit is contained in:
parent
4d7915a366
commit
f08636c518
1 changed files with 1 additions and 16 deletions
|
@ -228,16 +228,6 @@ func (*morphLoadWriter) Close() error {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
type nopLoadWriter struct{}
|
|
||||||
|
|
||||||
func (nopLoadWriter) Put(containerSDK.UsedSpaceAnnouncement) error {
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
|
|
||||||
func (nopLoadWriter) Close() error {
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
|
|
||||||
type remoteLoadAnnounceProvider struct {
|
type remoteLoadAnnounceProvider struct {
|
||||||
key *ecdsa.PrivateKey
|
key *ecdsa.PrivateKey
|
||||||
|
|
||||||
|
@ -251,15 +241,10 @@ type remoteLoadAnnounceProvider struct {
|
||||||
}
|
}
|
||||||
|
|
||||||
func (r *remoteLoadAnnounceProvider) InitRemote(srv loadroute.ServerInfo) (loadcontroller.WriterProvider, error) {
|
func (r *remoteLoadAnnounceProvider) InitRemote(srv loadroute.ServerInfo) (loadcontroller.WriterProvider, error) {
|
||||||
if srv == nil {
|
if srv == nil || r.netmapKeys.IsLocalKey(srv.PublicKey()) {
|
||||||
return r.deadEndProvider, nil
|
return r.deadEndProvider, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
if r.netmapKeys.IsLocalKey(srv.PublicKey()) {
|
|
||||||
// if local => return no-op writer
|
|
||||||
return loadcontroller.SimpleWriterProvider(new(nopLoadWriter)), nil
|
|
||||||
}
|
|
||||||
|
|
||||||
var info client.NodeInfo
|
var info client.NodeInfo
|
||||||
|
|
||||||
err := client.NodeInfoFromRawNetmapElement(&info, srv)
|
err := client.NodeInfoFromRawNetmapElement(&info, srv)
|
||||||
|
|
Loading…
Reference in a new issue