Skip to content

Commit

Permalink
Ensuring part numbers are sequential
Browse files Browse the repository at this point in the history
  • Loading branch information
glenrobson committed Jul 18, 2024
1 parent 7f8d3cb commit fc4d1e9
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -117,8 +117,7 @@ private class PartUploader implements Runnable {
@Override
public void run() {
try {
final int partNumber = partIndex + 1;

final int partNumber = partIndex++;
UploadPartRequest uploadPartRequest = UploadPartRequest.builder()
.bucket(bucket)
.key(key)
Expand Down Expand Up @@ -229,7 +228,9 @@ public void run() {
private boolean requestCreated;

private String uploadID;
private int partIndex;
// Part number must start with 1
// minio will hang if this is 0
private int partIndex = 1;
private long indexWithinPart;

/** For an instance to wait for an upload notification during testing. */
Expand Down Expand Up @@ -315,7 +316,6 @@ private void uploadPartIfNecessary() {
IOUtils.closeQuietly(currentPart);
currentPart = null;
indexWithinPart = 0;
partIndex++;
}
}

Expand Down

0 comments on commit fc4d1e9

Please sign in to comment.