Fixed a bug that caused check -chunks -persist to succeed with broken chunks

The bug was not setting the `isBroken` flag in WaitForChunk()
This commit is contained in:
Gilbert Chen
2020-09-24 14:53:42 -04:00
parent d0b3b5dc2e
commit 6841c989c6
2 changed files with 6 additions and 0 deletions

View File

@@ -1041,6 +1041,9 @@ func (manager *SnapshotManager) CheckSnapshots(snapshotID string, revisionsToChe
totalChunks := len(*allChunkHashes)
for i := 0; i < totalChunks; i++ {
chunk := manager.chunkDownloader.WaitForChunk(i + chunkIndex)
if chunk.isBroken {
continue
}
downloadedChunkSize += int64(chunk.GetLength())
elapsedTime := time.Now().Sub(startTime).Seconds()