~ knotless Search/
↑↓ move↵ open⇧↵ all results
0
0

The largest blob is PDS_BLOB_UPLOAD_LIMIT, as the reference's

Merged
Merged chadtmiller.com asked to merge into main from chadtmiller.com/monolith:limits/blob-upload-limit

The largest blob the server takes is now set by PDS_BLOB_UPLOAD_LIMIT, under the reference's name, rather than fixed at 5 MiB, so that a server taking accounts from a reference PDS configured for video can take their blobs. The default is unchanged.

Claude Opus 5.5 · high

What changes

spec/LIMITS.md, BLOBS.md, SPACES-EXPORT.md. PDS_BLOB_UPLOAD_LIMIT, in LIMITS.md's environment table: the bytes uploadBlob takes and describeServer answers as blobUploadLimit, and the bytes of a space repo's archive com.atproto.space.importRepo takes, 5242880 unless set. uploadBlob's and the space importRepo's size steps name it. "How it is checked" says what --limits does with it.

harness. In --limits, both sides start with the limit at 6291459 (LIMITS_UPLOAD_LIMIT in lib/env.mjs): past the default and not round. Two checks in checks/limits.mjs:

  • uploadSize, against the reference: describeServer's blobUploadLimit, then uploadBlob of a body a byte past 5 MiB, one at the limit and one a byte past it, each with its length or chunked, compared whole.
  • spaceImportSize, against the spec, as the reference here serves no spaces: a space importRepo of a body a byte past 5 MiB is 400 InvalidRequest (no archive), and one a byte past the limit is 413 PayloadTooLarge.

Every other run keeps the default, which checks/blobs.mjs still compares with the reference's.

crates/pds-server. Config::blob_upload_limit, read from the variable; uploadBlob, describeServer and the space importRepo's read and size check take it. blobs::UPLOAD_LIMIT becomes DEFAULT_UPLOAD_LIMIT, and limits::MAX_REPO_ARCHIVE_BODY goes, replaced by limits::archive_limit.

docs/guide. The variable in deploying.md's table, with when to raise it; comparing.md's --limits.

Why

Moving a reference PDS's accounts here copies each blob with uploadBlob (spec/MIGRATION.md, "The move", step 4). A reference PDS that serves the Bluesky app takes videos as blobs, so its upload limit is raised past 5 MiB. Here that limit could not be raised, so listMissingBlobs never emptied for any account holding such a blob. The reference reads the limit from PDS_BLOB_UPLOAD_LIMIT and bounds every body that is neither JSON nor text by it, the spaces alpha's importRepo archive among them, so the server does the same, as LIMITS.md's "as large as the largest upload" already said.

How it was checked

  • Against the server as it was: --limits --only uploadSize fails on describeServer (5242880 where the reference says 6291459), and --only spaceImportSize on a body a byte past 5 MiB (413 where the spec says 400).
  • Planted: uploadBlob keeping the default while describeServer answered the variable. uploadSize fails on the 5242881-byte upload, 200 on the reference and 413 on the server. Put back.
  • Changed server: both checks agree.
  • just quick.

Shortcomings

The spaces run (harness/spaces/compare.mjs) still runs its alpha reference and the server at the default only. A space importRepo under a limit that is set is held to the spec, not compared with the alpha.

Approved

This makes the blob upload limit configurable through PDS_BLOB_UPLOAD_LIMIT, defaulting to 5 MiB. uploadBlob, describeServer and the space importRepo all read it, and the spec, the guides and the harness change with the code.

  • Code: the old space importRepo bound in body_limit is replaced by archive_limit, wired into both read_limit and the handler's own size check. The other body_limit callers I looked at are JSON or proxy paths, so the move is consistent. I did not read the one at space_repo.rs:1198.
  • Spec: LIMITS.md, BLOBS.md and SPACES-EXPORT.md all carry the variable and its default, as do deploying.md and comparing.md.
  • Harness: the new checks only add comparisons. uploadSize compares with the reference, and spaceImportSize is held to the spec because the reference serves no spaces there. The limit 6291459 is past the default and not round, so a server that keeps the default or rounds would be caught. Other runs keep the default.
  • Server code: it adds no crates and takes nothing from the reference's source.

I only read the diff and searched the code. I did not run the checks. The PR body states that just quick passed and that the new checks fail against the old server.

Approved

Since the approved commit, the pull only reformats two spots: read_whole's signature in blobs.rs and the blob_upload_limit line in Config. Nothing about behaviour changes, so the earlier approval stands. I read only this diff and ran no checks.

Merged as 23b5458