fix(blob): scale multipart part size for uploads above 80 GiB - #1095
Open
Diwak4r wants to merge 2 commits into
Open
fix(blob): scale multipart part size for uploads above 80 GiB#1095Diwak4r wants to merge 2 commits into
Diwak4r wants to merge 2 commits into
Conversation
|
Contributor
|
@Normanyadav is attempting to deploy a commit to the Curated Tests - Permanent E2E Team on Vercel. A member of the Team first needs to authorize it. |
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
Diwak4r
force-pushed
the
fix/multipart-part-size-scaling
branch
from
August 5, 2026 02:20
99f06b8 to
28f2029
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Multipart uploads fail for files larger than 80 GiB because the part size is hardcoded to 8 MiB, and the Vercel Blob API enforces a maximum of 10,000 parts per upload (8 MiB × 10,000 = 80 GiB). This contradicts the advertised 5 TB support for multipart uploads.
The fix scales the part size up for bodies with a known size above 80 GiB so the part count always stays at or under 10,000, e.g. a 100 GiB body now uploads with ~10.2 MiB parts instead of failing at part 10,001.
Changes
packages/blob/src/multipart/upload.tsgetPartSizeInBytes(totalToLoad): returns the 8 MiB default for bodies at or under 80 GiB, otherwiseMath.ceil(totalToLoad / 10_000).uploadAllPartsnow derives the part size fromtotalToLoadinstead of the module-level constant.maxBytesInMemory) from the part size. It previously scaled with the part size (2 parts × concurrency), which would buffer gigabytes for the larger part sizes now used on big uploads; it stays at the previous 128 MiB ceiling.packages/blob/src/index.node.test.ts— new tests:getPartSizeInByteskeeps 8 MiB at/under the 80 GiB ceiling.Bodies with an unknown size (streams) keep the 8 MiB default, since the total length isn't known upfront.
Tests
test:node— 6 suites, 176 tests, 20 snapshots ✅test:edge— 1 suite, 1 test, 2 snapshots ✅test:browser— 3 suites, 19 tests, 3 snapshots ✅Fixes #1067