|
|
@ -303,6 +303,8 @@ func (xl xlObjects) listMultipartUploadsHeal(bucket, prefix, keyMarker, |
|
|
|
var walkerDoneCh chan struct{} |
|
|
|
var walkerDoneCh chan struct{} |
|
|
|
// Check if we have room left to send more uploads.
|
|
|
|
// Check if we have room left to send more uploads.
|
|
|
|
if maxUploads > 0 { |
|
|
|
if maxUploads > 0 { |
|
|
|
|
|
|
|
uploadsLeft := maxUploads |
|
|
|
|
|
|
|
|
|
|
|
walkerCh, walkerDoneCh = xl.listPool.Release(listParams{ |
|
|
|
walkerCh, walkerDoneCh = xl.listPool.Release(listParams{ |
|
|
|
bucket: minioMetaMultipartBucket, |
|
|
|
bucket: minioMetaMultipartBucket, |
|
|
|
recursive: recursive, |
|
|
|
recursive: recursive, |
|
|
@ -319,10 +321,14 @@ func (xl xlObjects) listMultipartUploadsHeal(bucket, prefix, keyMarker, |
|
|
|
multipartPrefixPath, multipartMarkerPath, |
|
|
|
multipartPrefixPath, multipartMarkerPath, |
|
|
|
recursive, listDir, isLeaf, walkerDoneCh) |
|
|
|
recursive, listDir, isLeaf, walkerDoneCh) |
|
|
|
} |
|
|
|
} |
|
|
|
// Collect uploads until maxUploads limit is reached.
|
|
|
|
// Collect uploads until leftUploads limit is reached.
|
|
|
|
for walkResult := range walkerCh { |
|
|
|
for { |
|
|
|
// For any error during tree walk we should
|
|
|
|
walkResult, ok := <-walkerCh |
|
|
|
// return right away.
|
|
|
|
if !ok { |
|
|
|
|
|
|
|
truncated = false |
|
|
|
|
|
|
|
break |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
// For any error during tree walk, we should return right away.
|
|
|
|
if walkResult.err != nil { |
|
|
|
if walkResult.err != nil { |
|
|
|
return ListMultipartsInfo{}, walkResult.err |
|
|
|
return ListMultipartsInfo{}, walkResult.err |
|
|
|
} |
|
|
|
} |
|
|
@ -334,8 +340,8 @@ func (xl xlObjects) listMultipartUploadsHeal(bucket, prefix, keyMarker, |
|
|
|
uploads = append(uploads, uploadMetadata{ |
|
|
|
uploads = append(uploads, uploadMetadata{ |
|
|
|
Object: entry, |
|
|
|
Object: entry, |
|
|
|
}) |
|
|
|
}) |
|
|
|
maxUploads-- |
|
|
|
uploadsLeft-- |
|
|
|
if maxUploads == 0 { |
|
|
|
if uploadsLeft == 0 { |
|
|
|
break |
|
|
|
break |
|
|
|
} |
|
|
|
} |
|
|
|
continue |
|
|
|
continue |
|
|
@ -347,20 +353,21 @@ func (xl xlObjects) listMultipartUploadsHeal(bucket, prefix, keyMarker, |
|
|
|
var end bool |
|
|
|
var end bool |
|
|
|
uploadIDMarker = "" |
|
|
|
uploadIDMarker = "" |
|
|
|
newUploads, end, err = fetchMultipartUploadIDs(bucket, entry, uploadIDMarker, |
|
|
|
newUploads, end, err = fetchMultipartUploadIDs(bucket, entry, uploadIDMarker, |
|
|
|
maxUploads, xl.getLoadBalancedDisks()) |
|
|
|
uploadsLeft, xl.getLoadBalancedDisks()) |
|
|
|
if err != nil { |
|
|
|
if err != nil { |
|
|
|
return ListMultipartsInfo{}, err |
|
|
|
return ListMultipartsInfo{}, err |
|
|
|
} |
|
|
|
} |
|
|
|
uploads = append(uploads, newUploads...) |
|
|
|
uploads = append(uploads, newUploads...) |
|
|
|
maxUploads -= len(newUploads) |
|
|
|
uploadsLeft -= len(newUploads) |
|
|
|
if end && walkResult.end { |
|
|
|
if end && walkResult.end { |
|
|
|
truncated = false |
|
|
|
truncated = false |
|
|
|
break |
|
|
|
break |
|
|
|
} |
|
|
|
} |
|
|
|
if maxUploads == 0 { |
|
|
|
if uploadsLeft == 0 { |
|
|
|
break |
|
|
|
break |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// For all received uploads fill in the multiparts result.
|
|
|
|
// For all received uploads fill in the multiparts result.
|
|
|
|