mirror of
https://github.com/jkl1337/duplicacy.git
synced 2026-01-03 12:14:39 -06:00
Download a fossil directly instead of turning it back to a chunk first
This is to avoid the read-after-rename consistency issue where the effect of renaming may not be observed by the subsequent attempt to download the just renamed chunk.
This commit is contained in:
@@ -427,17 +427,10 @@ func (downloader *ChunkDownloader) Download(threadIndex int, task ChunkDownloadT
|
|||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
// We can't download the fossil directly. We have to turn it back into a regular chunk and try
|
// Don't try to resurrect the fossil as we did before. This is to avoid the potential read-after-rename
|
||||||
// downloading again.
|
// consistency issue. Instead, download the fossil directly; resurrection should be taken care of later.
|
||||||
err = downloader.storage.MoveFile(threadIndex, fossilPath, chunkPath)
|
chunkPath = fossilPath
|
||||||
if err != nil {
|
LOG_WARN("DOWNLOAD_FOSSIL", "Chunk %s is a fossil", chunkID)
|
||||||
completeFailedChunk(chunk)
|
|
||||||
LOG_WERROR(downloader.allowFailures, "DOWNLOAD_CHUNK", "Failed to resurrect chunk %s: %v", chunkID, err)
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
|
|
||||||
LOG_WARN("DOWNLOAD_RESURRECT", "Fossil %s has been resurrected", chunkID)
|
|
||||||
continue
|
|
||||||
}
|
}
|
||||||
|
|
||||||
err = downloader.storage.DownloadFile(threadIndex, chunkPath, chunk)
|
err = downloader.storage.DownloadFile(threadIndex, chunkPath, chunk)
|
||||||
|
|||||||
Reference in New Issue
Block a user