Skip to content

Commit

Permalink
Fix #9985.
Browse files Browse the repository at this point in the history
  • Loading branch information
dkocher committed Jun 21, 2017
1 parent dbcdbcf commit 5b90284
Showing 1 changed file with 2 additions and 2 deletions.
Expand Up @@ -104,7 +104,7 @@ public StorageObject upload(final Path file, final Local local,
final List<Path> existingSegments = new ArrayList<Path>();
if(status.isAppend() || status.isRetry()) {
// Get a lexicographically ordered list of the existing file segments
existingSegments.addAll(listService.list(segmentService.getSegmentsDirectory(file, status.getLength()), new DisabledListProgressListener()).toList());
existingSegments.addAll(listService.list(segmentService.getSegmentsDirectory(file, status.getOffset() + status.getLength()), new DisabledListProgressListener()).toList());
}
// Get the results of the uploads in the order they were submitted
// this is important for building the manifest, and is not a problem in terms of performance
Expand All @@ -117,7 +117,7 @@ public StorageObject upload(final Path file, final Local local,
for(int segmentNumber = 1; remaining > 0; segmentNumber++) {
final Long length = Math.min(segmentSize, remaining);
// Segment name with left padded segment number
final Path segment = segmentService.getSegment(file, length, segmentNumber);
final Path segment = segmentService.getSegment(file, status.getOffset() + status.getLength(), segmentNumber);
if(existingSegments.contains(segment)) {
final Path existingSegment = existingSegments.get(existingSegments.indexOf(segment));
if(log.isDebugEnabled()) {
Expand Down

0 comments on commit 5b90284

Please sign in to comment.