Skip to content

fix(proxy): quote blob ETags consistently with local storage - #5072

Merged
milosgajdos merged 1 commit into
distribution:mainfrom
perfloop-oss:perfloop-pr-open-mncs1f521q
Nov 11, 2026
Merged

milosgajdos merged 1 commit into
distribution:mainfrom
perfloop-oss:perfloop-pr-open-mncs1f521q

Conversation

@perfloop-agent

@perfloop-agent perfloop-agent commented Nov 11, 2026 •

Copy link
Copy Markdown
Contributor

Quote the digest in the ETag returned by proxy blob copies, matching the local blob server’s strong entity tag. Previously, a client that reused the first download’s unquoted ETag in If-None-Match received the full unchanged blob after it entered the local cache. The same validator now produces a bodyless 304 Not Modified response on the subsequent warm GET.

registry/proxy/proxyblobstore_test.go adds a cold-to-warm regression test for empty, one-byte and 65-byte blobs. It reuses the cold validator verbatim, checks consistent quoted ETags, and verifies full-response bytes, content lengths and digest headers. A nonmatching validator still receives the full body.

The change is confined to ETag formatting in the shared proxy-copy header helper. It applies to both cache-populating copies and direct copies while another download is in flight. It does not change cache policy, digest headers, copy dispatch or opt-in Range forwarding. Conditional handling on a cold cache miss is unchanged.

Go tests passed for the ETag round trip, concurrent and large blob downloads, proxy metrics and the existing Range pass-through cases. Scoped lint and commit validation passed.

AI assistance was used in preparing this change.

Case and evidence


Made by Perfloop. Human sponsor: Tomás Senart.

@github-actions github-actions Bot added the area/proxy Related to registry as a pull-through cache label Nov 11, 2026
@milosgajdos

Copy link
Copy Markdown
Member

@perfloop-agent please squash your commits.

A cold proxy GET returns an unquoted digest as its ETag. Reusing that validator after the blob is cached misses the local server entity tag and transfers the body again. Quote the digest in the proxy response header so the same validator works across the cold-to-warm transition without changing cache policy or Range forwarding.

Replay an unchanged blob download through the proxy cache, then use the cold response validator for a conditional warm GET. Check full response bytes, lengths and digest headers as well as quoted ETag identity.

Signed-off-by: Perfloop Agent <[email protected]>
Signed-off-by: Tomás Senart <[email protected]>
Signed-off-by: Tomás Senart <[email protected]>
@perfloop
perfloop Bot force-pushed the perfloop-pr-open-mncs1f521q branch from b09e46d to 11575fc Compare November 11, 2026 12:48
@milosgajdos
milosgajdos merged commit 0a17283 into distribution:main Nov 11, 2026
25 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/proxy Related to registry as a pull-through cache

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants