diff --git a/pkg/local_object_storage/blobovnicza/iterate.go b/pkg/local_object_storage/blobovnicza/iterate.go index cf06282e54..18da2132c4 100644 --- a/pkg/local_object_storage/blobovnicza/iterate.go +++ b/pkg/local_object_storage/blobovnicza/iterate.go @@ -26,7 +26,7 @@ func (b *Blobovnicza) iterateBucketKeys(f func(uint64, uint64, []byte) (bool, er } func (b *Blobovnicza) iterateBounds(f func(uint64, uint64) (bool, error)) error { - for upper := firstBucketBound; upper <= b.objSizeLimit; upper *= 2 { + for upper := firstBucketBound; upper <= max(b.objSizeLimit, firstBucketBound); upper *= 2 { var lower uint64 if upper == firstBucketBound { @@ -44,3 +44,11 @@ func (b *Blobovnicza) iterateBounds(f func(uint64, uint64) (bool, error)) error return nil } + +func max(a, b uint64) uint64 { + if a > b { + return a + } + + return b +}