Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[stable26] Adjust the value of the "max-parts" parameter of the object storage 'ListPart' interface to 1000 #37776

Merged
merged 3 commits into from
Jun 13, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 18 additions & 7 deletions lib/private/Files/ObjectStore/S3.php
Original file line number Diff line number Diff line change
Expand Up @@ -69,13 +69,24 @@ public function uploadMultipartPart(string $urn, string $uploadId, int $partId,
}

public function getMultipartUploads(string $urn, string $uploadId): array {
$parts = $this->getConnection()->listParts([
'Bucket' => $this->bucket,
'Key' => $urn,
'UploadId' => $uploadId,
'MaxParts' => 10000
]);
return $parts->get('Parts') ?? [];
$parts = [];
$isTruncated = true;
$partNumberMarker = 0;

while ($isTruncated) {
$result = $this->getConnection()->listParts([
'Bucket' => $this->bucket,
'Key' => $urn,
'UploadId' => $uploadId,
'MaxParts' => 1000,
'PartNumberMarker' => $partNumberMarker
]);
$parts = array_merge($parts, $result->get('Parts') ?? []);
$isTruncated = $result->get('IsTruncated');
$partNumberMarker = $result->get('NextPartNumberMarker');
}

return $parts;
}

public function completeMultipartUpload(string $urn, string $uploadId, array $result): int {
Expand Down