lib/uplink: minor fixes (#2257)
This commit is contained in:
parent
d435d4859d
commit
06006effb3
@ -70,9 +70,6 @@ func (cfg *BucketConfig) setDefaults() {
|
||||
if cfg.EncryptionParameters.CipherSuite == storj.EncUnspecified {
|
||||
cfg.EncryptionParameters.CipherSuite = defaultCipher
|
||||
}
|
||||
if cfg.EncryptionParameters.BlockSize == 0 {
|
||||
cfg.EncryptionParameters.BlockSize = (1 * memory.KiB).Int32()
|
||||
}
|
||||
if cfg.Volatile.RedundancyScheme.RequiredShares == 0 {
|
||||
cfg.Volatile.RedundancyScheme.RequiredShares = 29
|
||||
}
|
||||
@ -88,6 +85,9 @@ func (cfg *BucketConfig) setDefaults() {
|
||||
if cfg.Volatile.RedundancyScheme.ShareSize == 0 {
|
||||
cfg.Volatile.RedundancyScheme.ShareSize = (1 * memory.KiB).Int32()
|
||||
}
|
||||
if cfg.EncryptionParameters.BlockSize == 0 {
|
||||
cfg.EncryptionParameters.BlockSize = cfg.Volatile.RedundancyScheme.ShareSize * int32(cfg.Volatile.RedundancyScheme.RequiredShares)
|
||||
}
|
||||
if cfg.Volatile.SegmentsSize.Int() == 0 {
|
||||
cfg.Volatile.SegmentsSize = 64 * memory.MiB
|
||||
}
|
||||
|
@ -5,7 +5,8 @@ package kvmetainfo
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
|
||||
"github.com/zeebo/errs"
|
||||
|
||||
"storj.io/storj/pkg/storage/buckets"
|
||||
"storj.io/storj/pkg/storj"
|
||||
@ -75,7 +76,7 @@ func validateBlockSize(redundancyScheme storj.RedundancyScheme, blockSize int32)
|
||||
stripeSize := redundancyScheme.StripeSize()
|
||||
|
||||
if blockSize%stripeSize != 0 {
|
||||
return fmt.Errorf("encryption BlockSize (%d) must be a multiple of RS ShareSize (%d) * RS RequiredShares (%d)",
|
||||
return errs.New("encryption BlockSize (%d) must be a multiple of RS ShareSize (%d) * RS RequiredShares (%d)",
|
||||
blockSize, redundancyScheme.ShareSize, redundancyScheme.RequiredShares,
|
||||
)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user