|
@ -24,7 +24,8 @@ func (fs *FilerSink) replicateChunks(sourceChunks []*filer_pb.FileChunk, path st |
|
|
var wg sync.WaitGroup |
|
|
var wg sync.WaitGroup |
|
|
for chunkIndex, sourceChunk := range sourceChunks { |
|
|
for chunkIndex, sourceChunk := range sourceChunks { |
|
|
wg.Add(1) |
|
|
wg.Add(1) |
|
|
go func(chunk *filer_pb.FileChunk, index int) { |
|
|
|
|
|
|
|
|
fs.executor.Execute(func() { |
|
|
|
|
|
func(chunk *filer_pb.FileChunk, index int) { |
|
|
defer wg.Done() |
|
|
defer wg.Done() |
|
|
replicatedChunk, e := fs.replicateOneChunk(chunk, path) |
|
|
replicatedChunk, e := fs.replicateOneChunk(chunk, path) |
|
|
if e != nil { |
|
|
if e != nil { |
|
@ -33,6 +34,7 @@ func (fs *FilerSink) replicateChunks(sourceChunks []*filer_pb.FileChunk, path st |
|
|
} |
|
|
} |
|
|
replicatedChunks[index] = replicatedChunk |
|
|
replicatedChunks[index] = replicatedChunk |
|
|
}(sourceChunk, chunkIndex) |
|
|
}(sourceChunk, chunkIndex) |
|
|
|
|
|
}) |
|
|
} |
|
|
} |
|
|
wg.Wait() |
|
|
wg.Wait() |
|
|
|
|
|
|
|
|