mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2025-09-23 10:53:34 +08:00
fix EC reading on nLargeBlockRows
fix https://github.com/seaweedfs/seaweedfs/issues/5465
This commit is contained in:
@@ -3,6 +3,7 @@ package erasure_coding
|
||||
import (
|
||||
"bytes"
|
||||
"fmt"
|
||||
"github.com/stretchr/testify/assert"
|
||||
"math/rand"
|
||||
"os"
|
||||
"testing"
|
||||
@@ -208,3 +209,14 @@ func (this Interval) sameAs(that Interval) bool {
|
||||
this.BlockIndex == that.BlockIndex &&
|
||||
this.Size == that.Size
|
||||
}
|
||||
|
||||
func TestLocateData2(t *testing.T) {
|
||||
intervals := LocateData(ErasureCodingLargeBlockSize, ErasureCodingSmallBlockSize, 32205678320, 21479557912, 4194339)
|
||||
assert.Equal(t, intervals, []Interval{
|
||||
{BlockIndex: 4, InnerBlockOffset: 527128, Size: 521448, IsLargeBlock: false, LargeBlockRowsCount: 2},
|
||||
{BlockIndex: 5, InnerBlockOffset: 0, Size: 1048576, IsLargeBlock: false, LargeBlockRowsCount: 2},
|
||||
{BlockIndex: 6, InnerBlockOffset: 0, Size: 1048576, IsLargeBlock: false, LargeBlockRowsCount: 2},
|
||||
{BlockIndex: 7, InnerBlockOffset: 0, Size: 1048576, IsLargeBlock: false, LargeBlockRowsCount: 2},
|
||||
{BlockIndex: 8, InnerBlockOffset: 0, Size: 527163, IsLargeBlock: false, LargeBlockRowsCount: 2},
|
||||
})
|
||||
}
|
||||
|
Reference in New Issue
Block a user