From 8616fc146de5d428596df4ac7e4fe2b28e479bdd Mon Sep 17 00:00:00 2001 From: paul cannon Date: Tue, 27 Oct 2020 22:15:09 -0500 Subject: [PATCH] satellite/orders: send IPs for graceful exit Storage nodes undergoing Graceful Exit have up to now been receiving hostnames for all other storage nodes they need to contact when transferring pieces. This adds up to a lot of DNS lookups, which apparently overwhelm some home routers. There does not seem to be any need for us to send hostnames for graceful exit as opposed to IP addresses; we already use IP addresses (as given by the last_ip_port column in the nodes table) for all the GET and PUT orders we send out. This change causes IP addresses to be used instead. I started trying to construct a test to ensure that the behavior changed, but it was rabbit-holing, so I've begun to feel that maybe this change doesn't require one; it is a very simple change, and very much of the same nature as what we already do for IPs in CreateGetOrderLimits and CreatePutOrderLimits (and others). Change-Id: Ib2b5ffe7a9310e9cdbe7464450cc7c934fa229a1 --- satellite/orders/service.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/satellite/orders/service.go b/satellite/orders/service.go index 2b8f96d6c..32d96ade6 100644 --- a/satellite/orders/service.go +++ b/satellite/orders/service.go @@ -566,7 +566,11 @@ func (service *Service) CreateGracefulExitPutOrderLimit(ctx context.Context, buc return nil, storj.PiecePrivateKey{}, Error.Wrap(err) } - nodeURL := storj.NodeURL{ID: nodeID, Address: node.Address.Address} + address := node.Address.Address + if node.LastIPPort != "" { + address = node.LastIPPort + } + nodeURL := storj.NodeURL{ID: nodeID, Address: address} limit, err = signer.Sign(ctx, nodeURL, pieceNum) if err != nil { return nil, storj.PiecePrivateKey{}, Error.Wrap(err)