mirror of
https://github.com/minio/minio.git
synced 2025-01-12 07:23:23 -05:00
Merge pull request #402 from fkautz/pr_out_fix_for_readers_closing_in_erasure_early
This commit is contained in:
commit
fa6ee236f7
@ -15,6 +15,7 @@ import (
|
|||||||
"github.com/minio-io/minio/pkg/encoding/erasure"
|
"github.com/minio-io/minio/pkg/encoding/erasure"
|
||||||
"github.com/minio-io/minio/pkg/utils/split"
|
"github.com/minio-io/minio/pkg/utils/split"
|
||||||
"hash"
|
"hash"
|
||||||
|
"log"
|
||||||
)
|
)
|
||||||
|
|
||||||
// getErasureTechnique - convert technique string into Technique type
|
// getErasureTechnique - convert technique string into Technique type
|
||||||
@ -75,6 +76,7 @@ func erasureReader(readers []io.ReadCloser, donutMetadata map[string]string, wri
|
|||||||
}
|
}
|
||||||
encoder := erasure.NewEncoder(params)
|
encoder := erasure.NewEncoder(params)
|
||||||
for i := 0; i < totalChunks; i++ {
|
for i := 0; i < totalChunks; i++ {
|
||||||
|
log.Println(i)
|
||||||
totalLeft, err = decodeChunk(writer, readers, encoder, hasher, k, m, totalLeft, blockSize)
|
totalLeft, err = decodeChunk(writer, readers, encoder, hasher, k, m, totalLeft, blockSize)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
errParams := map[string]string{
|
errParams := map[string]string{
|
||||||
@ -106,7 +108,6 @@ func decodeChunk(writer *io.PipeWriter, readers []io.ReadCloser, encoder *erasur
|
|||||||
curChunkSize := erasure.GetEncodedBlockLen(curBlockSize, uint8(k))
|
curChunkSize := erasure.GetEncodedBlockLen(curBlockSize, uint8(k))
|
||||||
encodedBytes := make([][]byte, 16)
|
encodedBytes := make([][]byte, 16)
|
||||||
for i, reader := range readers {
|
for i, reader := range readers {
|
||||||
defer reader.Close()
|
|
||||||
var bytesBuffer bytes.Buffer
|
var bytesBuffer bytes.Buffer
|
||||||
written, err := io.CopyN(&bytesBuffer, reader, int64(curChunkSize))
|
written, err := io.CopyN(&bytesBuffer, reader, int64(curChunkSize))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
Loading…
Reference in New Issue
Block a user