diff --git a/go.mod b/go.mod index 071f4fee0..d443f9627 100644 --- a/go.mod +++ b/go.mod @@ -59,7 +59,7 @@ require ( golang.org/x/time v0.0.0-20200630173020-3af7569d3a1e gopkg.in/segmentio/analytics-go.v3 v3.1.0 gopkg.in/yaml.v3 v3.0.1 - storj.io/common v0.0.0-20230419134608-0971ce717d0c + storj.io/common v0.0.0-20230428200501-099739f940f7 storj.io/drpc v0.0.33-0.20230417171205-2ca712ef4ab5 storj.io/monkit-jaeger v0.0.0-20220915074555-d100d7589f41 storj.io/private v0.0.0-20230405095015-9e5bbc1c7ca8 diff --git a/go.sum b/go.sum index 6dfbc8424..8041681a4 100644 --- a/go.sum +++ b/go.sum @@ -974,8 +974,8 @@ rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8 sourcegraph.com/sourcegraph/go-diff v0.5.0/go.mod h1:kuch7UrkMzY0X+p9CRK03kfuPQ2zzQcaEFbx8wA8rck= sourcegraph.com/sqs/pbtypes v0.0.0-20180604144634-d3ebe8f20ae4/go.mod h1:ketZ/q3QxT9HOBeFhu6RdvsftgpsbFHBF5Cas6cDKZ0= storj.io/common v0.0.0-20220719163320-cd2ef8e1b9b0/go.mod h1:mCYV6Ud5+cdbuaxdPD5Zht/HYaIn0sffnnws9ErkrMQ= -storj.io/common v0.0.0-20230419134608-0971ce717d0c h1:v7SwkKqxtTp4w0tKpqeBu5d/8Dqd0Rxy/L1HT7O0qAY= -storj.io/common v0.0.0-20230419134608-0971ce717d0c/go.mod h1:j5YdcshmpJL+oW1+3IyBnCsv/HGbFkbzNDtuZg24KF0= +storj.io/common v0.0.0-20230428200501-099739f940f7 h1:2EIBMx6+bv52uY5eWE6GDFLOm5zwqkxu00jEDCTGp/E= +storj.io/common v0.0.0-20230428200501-099739f940f7/go.mod h1:j5YdcshmpJL+oW1+3IyBnCsv/HGbFkbzNDtuZg24KF0= storj.io/drpc v0.0.32/go.mod h1:6rcOyR/QQkSTX/9L5ZGtlZaE2PtXTTZl8d+ulSeeYEg= storj.io/drpc v0.0.33-0.20230417171205-2ca712ef4ab5 h1:4iOQovjXb6oAMLrjf0Qc4MuRRLd9hXC7+CWqOt+AzCw= storj.io/drpc v0.0.33-0.20230417171205-2ca712ef4ab5/go.mod h1:vR804UNzhBa49NOJ6HeLjd2H3MakC1j5Gv8bsOQT6N4= diff --git a/storagenode/piecestore/endpoint.go b/storagenode/piecestore/endpoint.go index afdb31ac2..af24d3df7 100644 --- a/storagenode/piecestore/endpoint.go +++ b/storagenode/piecestore/endpoint.go @@ -583,6 +583,11 @@ func (endpoint *Endpoint) Download(stream pb.DRPCPiecestore_DownloadStream) (err "requested more that order limit allows, limit=%v requested=%v", limit.Limit, chunk.ChunkSize) } + maximumChunkSize := 1 * memory.MiB.Int64() + if memory.KiB.Int32() < message.MaximumChunkSize && message.MaximumChunkSize < memory.MiB.Int32() { + maximumChunkSize = int64(message.MaximumChunkSize) + } + actionSeriesTag := monkit.NewSeriesTag("action", limit.Action.String()) remoteAddr := getRemoteAddr(ctx) @@ -692,8 +697,6 @@ func (endpoint *Endpoint) Download(stream pb.DRPCPiecestore_DownloadStream) (err group, ctx := errgroup.WithContext(ctx) group.Go(func() (err error) { - var maximumChunkSize = 1 * memory.MiB.Int64() - currentOffset := chunk.Offset unsentAmount := chunk.ChunkSize diff --git a/testsuite/storjscan/go.mod b/testsuite/storjscan/go.mod index 85c53f111..cbfd5fb58 100644 --- a/testsuite/storjscan/go.mod +++ b/testsuite/storjscan/go.mod @@ -9,7 +9,7 @@ require ( github.com/zeebo/errs v1.3.0 go.uber.org/zap v1.21.0 golang.org/x/sync v0.1.0 - storj.io/common v0.0.0-20230419134608-0971ce717d0c + storj.io/common v0.0.0-20230428200501-099739f940f7 storj.io/private v0.0.0-20230405095015-9e5bbc1c7ca8 storj.io/storj v1.63.1 storj.io/storjscan v0.0.0-20220926140643-1623c3b391b0 diff --git a/testsuite/storjscan/go.sum b/testsuite/storjscan/go.sum index 09cbf4f25..f0ff917fe 100644 --- a/testsuite/storjscan/go.sum +++ b/testsuite/storjscan/go.sum @@ -1229,8 +1229,8 @@ rsc.io/pdf v0.1.1/go.mod h1:n8OzWcQ6Sp37PL01nO98y4iUCRdTGarVfzxY20ICaU4= sourcegraph.com/sourcegraph/go-diff v0.5.0/go.mod h1:kuch7UrkMzY0X+p9CRK03kfuPQ2zzQcaEFbx8wA8rck= sourcegraph.com/sqs/pbtypes v0.0.0-20180604144634-d3ebe8f20ae4/go.mod h1:ketZ/q3QxT9HOBeFhu6RdvsftgpsbFHBF5Cas6cDKZ0= storj.io/common v0.0.0-20220719163320-cd2ef8e1b9b0/go.mod h1:mCYV6Ud5+cdbuaxdPD5Zht/HYaIn0sffnnws9ErkrMQ= -storj.io/common v0.0.0-20230419134608-0971ce717d0c h1:v7SwkKqxtTp4w0tKpqeBu5d/8Dqd0Rxy/L1HT7O0qAY= -storj.io/common v0.0.0-20230419134608-0971ce717d0c/go.mod h1:j5YdcshmpJL+oW1+3IyBnCsv/HGbFkbzNDtuZg24KF0= +storj.io/common v0.0.0-20230428200501-099739f940f7 h1:2EIBMx6+bv52uY5eWE6GDFLOm5zwqkxu00jEDCTGp/E= +storj.io/common v0.0.0-20230428200501-099739f940f7/go.mod h1:j5YdcshmpJL+oW1+3IyBnCsv/HGbFkbzNDtuZg24KF0= storj.io/drpc v0.0.32/go.mod h1:6rcOyR/QQkSTX/9L5ZGtlZaE2PtXTTZl8d+ulSeeYEg= storj.io/drpc v0.0.33-0.20230417171205-2ca712ef4ab5 h1:4iOQovjXb6oAMLrjf0Qc4MuRRLd9hXC7+CWqOt+AzCw= storj.io/drpc v0.0.33-0.20230417171205-2ca712ef4ab5/go.mod h1:vR804UNzhBa49NOJ6HeLjd2H3MakC1j5Gv8bsOQT6N4= diff --git a/testsuite/ui/go.mod b/testsuite/ui/go.mod index a5a88aa54..a16cb3382 100644 --- a/testsuite/ui/go.mod +++ b/testsuite/ui/go.mod @@ -10,7 +10,7 @@ require ( github.com/spf13/pflag v1.0.5 github.com/stretchr/testify v1.8.2 go.uber.org/zap v1.23.0 - storj.io/common v0.0.0-20230419134608-0971ce717d0c + storj.io/common v0.0.0-20230428200501-099739f940f7 storj.io/gateway-mt v1.51.1-0.20230417204402-7d9bb25bc297 storj.io/private v0.0.0-20230405095015-9e5bbc1c7ca8 storj.io/storj v0.12.1-0.20221125175451-ef4b564b82f7 diff --git a/testsuite/ui/go.sum b/testsuite/ui/go.sum index ede98f4d1..0b0150950 100644 --- a/testsuite/ui/go.sum +++ b/testsuite/ui/go.sum @@ -1933,8 +1933,8 @@ sourcegraph.com/sourcegraph/appdash v0.0.0-20190731080439-ebfcffb1b5c0/go.mod h1 sourcegraph.com/sourcegraph/go-diff v0.5.0/go.mod h1:kuch7UrkMzY0X+p9CRK03kfuPQ2zzQcaEFbx8wA8rck= sourcegraph.com/sqs/pbtypes v0.0.0-20180604144634-d3ebe8f20ae4/go.mod h1:ketZ/q3QxT9HOBeFhu6RdvsftgpsbFHBF5Cas6cDKZ0= storj.io/common v0.0.0-20220719163320-cd2ef8e1b9b0/go.mod h1:mCYV6Ud5+cdbuaxdPD5Zht/HYaIn0sffnnws9ErkrMQ= -storj.io/common v0.0.0-20230419134608-0971ce717d0c h1:v7SwkKqxtTp4w0tKpqeBu5d/8Dqd0Rxy/L1HT7O0qAY= -storj.io/common v0.0.0-20230419134608-0971ce717d0c/go.mod h1:j5YdcshmpJL+oW1+3IyBnCsv/HGbFkbzNDtuZg24KF0= +storj.io/common v0.0.0-20230428200501-099739f940f7 h1:2EIBMx6+bv52uY5eWE6GDFLOm5zwqkxu00jEDCTGp/E= +storj.io/common v0.0.0-20230428200501-099739f940f7/go.mod h1:j5YdcshmpJL+oW1+3IyBnCsv/HGbFkbzNDtuZg24KF0= storj.io/dotworld v0.0.0-20210324183515-0d11aeccd840 h1:oqMwoF6vaOrCe92SKRyr8cc2WSjLYAd8fjpAHA7rNqY= storj.io/drpc v0.0.32/go.mod h1:6rcOyR/QQkSTX/9L5ZGtlZaE2PtXTTZl8d+ulSeeYEg= storj.io/drpc v0.0.33-0.20230417171205-2ca712ef4ab5 h1:4iOQovjXb6oAMLrjf0Qc4MuRRLd9hXC7+CWqOt+AzCw=