Skip to content

Defer large collection version fields that the API does not render - #2734

Open
pablomh wants to merge 1 commit into
pulp:mainfrom
pablomh:collection-version-listing-perf
Open

pablomh wants to merge 1 commit into
pulp:mainfrom
pablomh:collection-version-listing-perf

Conversation

@pablomh

@pablomh pablomh commented Nov 11, 2026

Copy link
Copy Markdown
Contributor

Problem

CollectionVersion carries large JSON columns (docs_blob, files, manifest, contents) that most listing responses never render. The serializer redacts them for GET, but the ORM still selects and deserializes them, so every list request pays for the full payload.

Measured on a 672-row page: the queryset alone peaks at 2,319 MB with all columns and 150 MB when the large fields are deferred. On a ?limit=2000 request the API worker peaked at 4,300-7,300 MB and was OOM-killed, returning a 502 to the caller; after the change it peaks at 191 MB, with a byte-identical response.

Change

  • Defer the large fields in the viewsets that serve them, using the same fields / exclude_fields semantics as the serializer (repeated parameters, configurable argument names and delimiter, empty values).
  • Keep the serializer redaction in sync with that selection, and treat HEAD like GET.
  • Prefetch artifacts only when a checksum field is rendered.
  • The galaxy v3 list, unpaginated and docs endpoints defer the fields they do not return.

Companion change, independent of this one: #2733.

🤖 Generated with Claude Code

CollectionVersion carries large JSON columns (docs_blob, files, manifest,
contents) that most listing responses never render. Loading them for every
row dominated memory and time when listing collection versions.

Defer the large fields in the viewsets that serve them, keep the serializer
redaction in sync with the request's field selection instead of only
checking whether fields or exclude_fields is present, treat HEAD like GET,
and only prefetch artifacts when a checksum field is rendered. The galaxy
v3 list, unpaginated and docs endpoints defer the fields they do not
return.

Co-Authored-By: Claude Code <noreply@anthropic.com>
@pablomh
pablomh force-pushed the collection-version-listing-perf branch from 86fde34 to dd1095d Compare November 12, 2026 11:42

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant