allocate ec shards to volume servers

This commit is contained in:
Chris Lu
2019-05-25 02:02:44 -07:00
parent 6f4b09b6a4
commit f0e6574d5e
6 changed files with 172 additions and 14 deletions

View File

@@ -153,9 +153,9 @@ func readFromOtherEcFiles(ecFiles []*os.File, ecFileIndex int, ecFileOffset int6
return nil, fmt.Errorf("failed to create encoder: %v", err)
}
bufs := make([][]byte, DataShardsCount+ParityShardsCount)
bufs := make([][]byte, TotalShardsCount)
for i := 0; i < DataShardsCount; {
n := int(rand.Int31n(DataShardsCount + ParityShardsCount))
n := int(rand.Int31n(TotalShardsCount))
if n == ecFileIndex || bufs[n] != nil {
continue
}