XL: Cache: Purging partially cached content upon erasureReadFile failure (#2104)

This commit is contained in:
karthic rao 2016-07-06 01:18:54 +05:30 committed by Harshavardhana
parent d6dfcd0ba7
commit a35341448f

View File

@ -153,6 +153,8 @@ func (xl xlObjects) GetObject(bucket, object string, startOffset int64, length i
// Start reading the part name.
n, err := erasureReadFile(mw, onlineDisks, bucket, pathJoin(object, partName), partName, eInfos, partOffset, readSize, partSize)
if err != nil {
// Purge the partial object upon any error.
xl.objCache.Delete(path.Join(bucket, object))
return err
}