filer sink retries reading file chunks, skipping missing chunks

if the file chunk is not available during replication time, the file is skipped
This commit is contained in:
chrislu
2022-12-19 11:31:58 -08:00
parent 3fc3e7083c
commit 6c7fe40305
2 changed files with 15 additions and 9 deletions

View File

@@ -27,12 +27,16 @@ func (fs *FilerSink) replicateChunks(sourceChunks []*filer_pb.FileChunk, path st
index, source := chunkIndex, sourceChunk
fs.executor.Execute(func() {
defer wg.Done()
replicatedChunk, e := fs.replicateOneChunk(source, path)
if e != nil {
err = e
return
}
replicatedChunks[index] = replicatedChunk
util.Retry("replicate chunks", func() error {
replicatedChunk, e := fs.replicateOneChunk(source, path)
if e != nil {
err = e
return e
}
replicatedChunks[index] = replicatedChunk
err = nil
return nil
})
})
}
wg.Wait()