Skip to content

Commit

Permalink
mod: bump uplink
Browse files Browse the repository at this point in the history
uplink stopped using zap, hence some of the private methods needed to be
changed.

Change-Id: Iac1fae45a40cd3f1649b9f672bf8c250344986d5
  • Loading branch information
egonelbre committed May 6, 2021
1 parent 2f8969a commit 69b149a
Show file tree
Hide file tree
Showing 9 changed files with 17 additions and 23 deletions.
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -52,5 +52,5 @@ require (
storj.io/drpc v0.0.20
storj.io/monkit-jaeger v0.0.0-20210426161729-debb1cbcbbd7
storj.io/private v0.0.0-20210429173958-0e792382d191
storj.io/uplink v1.5.0-rc.1.0.20210430131802-f57493cc5b2e
storj.io/uplink v1.5.0-rc.1.0.20210506124440-cfeb286eeeb9
)
14 changes: 6 additions & 8 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -386,9 +386,8 @@ github.com/pelletier/go-toml v1.2.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/9
github.com/pelletier/go-toml v1.9.0 h1:NOd0BRdOKpPf0SxkL3HxSQOG7rNh+4kl6PHcBPFs7Q0=
github.com/pelletier/go-toml v1.9.0/go.mod h1:u1nR/EPcESfeI/szUZKdtJ0xRNbUoANCkoOuaOx1Y+c=
github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
github.com/pkg/errors v0.8.1 h1:iURUrRGxPUNPdy5/HRSm+Yj6okJ6UtLINN0Q9M4+h3I=
github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4=
github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
github.com/pkg/sftp v1.10.1/go.mod h1:lYOWFsE0bwd1+KfKJaKeuokY15vzFx25BLbzYYoAxZI=
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
Expand Down Expand Up @@ -547,13 +546,12 @@ go.opentelemetry.io/otel/trace v0.18.0 h1:ilCfc/fptVKaDMK1vWk0elxpolurJbEgey9J6g
go.opentelemetry.io/otel/trace v0.18.0/go.mod h1:FzdUu3BPwZSZebfQ1vl5/tAa8LyMLXSJN57AXIt/iDk=
go.uber.org/atomic v1.3.2/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE=
go.uber.org/atomic v1.4.0/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE=
go.uber.org/atomic v1.6.0 h1:Ezj3JGmsOnG1MoRWQkPBsKLe9DwWD9QeXzTRzzldNVk=
go.uber.org/atomic v1.6.0/go.mod h1:sABNBOSYdrvTF6hTgEIbc7YasKWGhgEQZyfxyTvoXHQ=
go.uber.org/atomic v1.7.0 h1:ADUqmZGgLDDfbSL9ZmPxKTybcoEYHgpYfELNoN+7hsw=
go.uber.org/atomic v1.7.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc=
go.uber.org/multierr v1.1.0/go.mod h1:wR5kodmAFQ0UK8QlbwjlSNy0Z68gJhDJUG5sjR94q/0=
go.uber.org/multierr v1.5.0 h1:KCa4XfM8CWFCpxXRGok+Q0SS/0XBhMDbHHGABQLvD2A=
go.uber.org/multierr v1.5.0/go.mod h1:FeouvMocqHpRaaGuG9EjoKcStLC43Zu/fmqdUMPcKYU=
go.uber.org/multierr v1.6.0 h1:y6IPFStTAIT5Ytl7/XYmHvzXQ7S3g/IeZW9hyZ5thw4=
go.uber.org/multierr v1.6.0/go.mod h1:cdWPpRnG4AhwMwsgIHip0KRBQjJy5kYEpYjJxpXp9iU=
go.uber.org/tools v0.0.0-20190618225709-2cfd321de3ee h1:0mgffUl7nfd+FpvXMVz4IDEaUSmT1ysygQC7qYo7sG4=
go.uber.org/tools v0.0.0-20190618225709-2cfd321de3ee/go.mod h1:vJERXedbb3MVM5f9Ejo0C68/HhF8uaILCdgjnY+goOA=
go.uber.org/zap v1.9.1/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q=
go.uber.org/zap v1.10.0/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q=
Expand Down Expand Up @@ -854,5 +852,5 @@ storj.io/monkit-jaeger v0.0.0-20210426161729-debb1cbcbbd7 h1:zi0w9zoBfvuqysSAqxJ
storj.io/monkit-jaeger v0.0.0-20210426161729-debb1cbcbbd7/go.mod h1:gj4vuCeyCRjRmH8LIrgoyU9Dc9uR6H+/GcDUXmTbf80=
storj.io/private v0.0.0-20210429173958-0e792382d191 h1:3G4zwDJB/+71A5ahHldelS/TzBkUIuRTn8qwLTD2vck=
storj.io/private v0.0.0-20210429173958-0e792382d191/go.mod h1:iAc+LGwXYCe+YRRTlkfkg95ZBEL8pWHLVZ508/KQjOs=
storj.io/uplink v1.5.0-rc.1.0.20210430131802-f57493cc5b2e h1:Ilx1mpfe1OYbPliqhinHyYQC6t0LbgkpGUH1L2Sc3yU=
storj.io/uplink v1.5.0-rc.1.0.20210430131802-f57493cc5b2e/go.mod h1:yiJ43I+y5VJB1WrGMk6pWuR4LS/4a7EC3kIawoGCvjE=
storj.io/uplink v1.5.0-rc.1.0.20210506124440-cfeb286eeeb9 h1:rSP8cSfLqkYtRLUlGkwj1CeafNf7YPRgTstgwHu0tC8=
storj.io/uplink v1.5.0-rc.1.0.20210506124440-cfeb286eeeb9/go.mod h1:VzJd+P1sfcVnGCxm0mPPhOBkbov0gLZ+/QXeKkkZ1tI=
2 changes: 1 addition & 1 deletion private/testplanet/uplink.go
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ func (client *Uplink) DialMetainfo(ctx context.Context, destination Peer, apikey

// DialPiecestore dials destination storagenode and returns a piecestore client.
func (client *Uplink) DialPiecestore(ctx context.Context, destination Peer) (*piecestore.Client, error) {
return piecestore.DialNodeURL(ctx, client.Dialer, destination.NodeURL(), client.Log.Named("uplink>piecestore"), piecestore.DefaultConfig)
return piecestore.Dial(ctx, client.Dialer, destination.NodeURL(), piecestore.DefaultConfig)
}

// OpenProject opens project with predefined access grant and gives access to pure uplink API.
Expand Down
2 changes: 1 addition & 1 deletion private/testuplink/client_planet_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ func TestECClient(t *testing.T) {
SatelliteCount: 1, StorageNodeCount: storageNodes, UplinkCount: 1,
}, func(t *testing.T, ctx *testcontext.Context, planet *testplanet.Planet) {

ec := ecclient.NewClient(planet.Uplinks[0].Log.Named("ecclient"), planet.Uplinks[0].Dialer, 0)
ec := ecclient.New(planet.Uplinks[0].Dialer, 0)

k := storageNodes / 2
n := storageNodes
Expand Down
4 changes: 2 additions & 2 deletions satellite/audit/verifier.go
Original file line number Diff line number Diff line change
Expand Up @@ -629,7 +629,7 @@ func (verifier *Verifier) GetShare(ctx context.Context, limit *pb.AddressedOrder
ID: targetNodeID,
Address: cachedIPAndPort,
}
ps, err = piecestore.DialNodeURL(timedCtx, verifier.dialer, nodeAddr, log, piecestore.DefaultConfig)
ps, err = piecestore.Dial(timedCtx, verifier.dialer, nodeAddr, piecestore.DefaultConfig)
if err != nil {
log.Debug("failed to connect to audit target node at cached IP", zap.String("cached-ip-and-port", cachedIPAndPort), zap.Error(err))
}
Expand All @@ -641,7 +641,7 @@ func (verifier *Verifier) GetShare(ctx context.Context, limit *pb.AddressedOrder
ID: targetNodeID,
Address: limit.GetStorageNodeAddress().Address,
}
ps, err = piecestore.DialNodeURL(timedCtx, verifier.dialer, nodeAddr, log, piecestore.DefaultConfig)
ps, err = piecestore.Dial(timedCtx, verifier.dialer, nodeAddr, piecestore.DefaultConfig)
if err != nil {
return Share{}, Error.Wrap(err)
}
Expand Down
4 changes: 1 addition & 3 deletions satellite/gc/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -150,8 +150,6 @@ func (service *Service) Run(ctx context.Context) (err error) {
func (service *Service) sendRetainRequest(ctx context.Context, id storj.NodeID, info *RetainInfo) (err error) {
defer mon.Task()(&ctx, id.String())(&err)

log := service.log.Named(id.String())

dossier, err := service.overlay.Get(ctx, id)
if err != nil {
return Error.Wrap(err)
Expand All @@ -168,7 +166,7 @@ func (service *Service) sendRetainRequest(ctx context.Context, id storj.NodeID,
Address: dossier.Address.Address,
}

client, err := piecestore.DialNodeURL(ctx, service.dialer, nodeurl, log, piecestore.DefaultConfig)
client, err := piecestore.Dial(ctx, service.dialer, nodeurl, piecestore.DefaultConfig)
if err != nil {
return Error.Wrap(err)
}
Expand Down
7 changes: 3 additions & 4 deletions satellite/repair/repairer/ec.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,7 @@ func NewECRepairer(log *zap.Logger, dialer rpc.Dialer, satelliteSignee signing.S
}

func (ec *ECRepairer) dialPiecestore(ctx context.Context, n storj.NodeURL) (*piecestore.Client, error) {
logger := ec.log.Named(n.ID.String())
return piecestore.DialNodeURL(ctx, ec.dialer, n, logger, piecestore.DefaultConfig)
return piecestore.Dial(ctx, ec.dialer, n, piecestore.DefaultConfig)
}

// Get downloads pieces from storagenodes using the provided order limits, and decodes those pieces into a segment.
Expand Down Expand Up @@ -162,7 +161,7 @@ func (ec *ECRepairer) Get(ctx context.Context, limits []*pb.AddressedOrderLimit,
expectedSize := pieceSize * int64(es.RequiredCount())

ctx, cancel := context.WithCancel(ctx)
decodeReader := eestream.DecodeReaders(ctx, cancel, ec.log.Named("decode readers"), pieceReaders, esScheme, expectedSize, 0, false)
decodeReader := eestream.DecodeReaders2(ctx, cancel, pieceReaders, esScheme, expectedSize, 0, false)

return decodeReader, failedPieces, nil
}
Expand Down Expand Up @@ -297,7 +296,7 @@ func (ec *ECRepairer) Repair(ctx context.Context, limits []*pb.AddressedOrderLim
return nil, nil, Error.New("duplicated nodes are not allowed")
}

readers, err := eestream.EncodeReader(ctx, ec.log, ioutil.NopCloser(data), rs)
readers, err := eestream.EncodeReader2(ctx, ioutil.NopCloser(data), rs)
if err != nil {
return nil, nil, err
}
Expand Down
2 changes: 1 addition & 1 deletion storagenode/piecestore/endpoint_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -566,7 +566,7 @@ func TestTooManyRequests(t *testing.T) {
storageNode := planet.StorageNodes[0]
config := piecestore.DefaultConfig

client, err := piecestore.DialNodeURL(ctx, uplink.Dialer, storageNode.NodeURL(), uplink.Log, config)
client, err := piecestore.Dial(ctx, uplink.Dialer, storageNode.NodeURL(), config)
if err != nil {
return err
}
Expand Down
3 changes: 1 addition & 2 deletions storagenode/piecetransfer/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,12 +54,11 @@ type service struct {

// NewService is a constructor for Service.
func NewService(log *zap.Logger, store *pieces.Store, trust *trust.Pool, dialer rpc.Dialer, minDownloadTimeout time.Duration, minBytesPerSecond memory.Size) Service {
ecClient := ecclient.NewClient(log, dialer, 0)
return &service{
log: log,
store: store,
trust: trust,
ecClient: ecClient,
ecClient: ecclient.New(dialer, 0),
minDownloadTimeout: minDownloadTimeout,
minBytesPerSecond: minBytesPerSecond,
}
Expand Down

0 comments on commit 69b149a

Please sign in to comment.