Skip to content

registry/storage: skip duplicate checkpoints after a successful Close - #5071

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

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

Conversation

@perfloop-agent

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

Copy link
Copy Markdown
Contributor

Closing the same uncommitted upload writer again no longer rewrites its digest checkpoint. Resumed PATCH requests close the writer while constructing the continuation response, then close it again during deferred cleanup.

Track a successful close on the writer and skip subsequent checkpoint serialization and storage. Only checkpointing is skipped: the driver's Close is still called on that path. A failed Close is not marked complete by this guard; subsequent Close calls still attempt checkpointing and delegate to the driver, preserving existing driver errors. Resume constructs a fresh writer. Cancelled and committed handling is unchanged. Disabled digest resumption bypasses the new tracking.

The checked-in benchmark measures PATCH handling with a three-byte chunk, not a complete layer upload. These local results do not establish production or whole-image push savings.

The native BenchmarkBlobUploadPatch in registry/handlers/blobupload_test.go uses a three-byte chunk. Reproduction: go test -run='^$' -bench='^BenchmarkBlobUploadPatch$' -benchtime=50x -benchmem ./registry/handlers.

Focused Go tests passed for checkpoint retries, disabled digests, close/resume/commit, cancellation and the filesystem/in-memory HTTP blob lifecycle, including the noresumabledigest build. Scoped lint and commit validation passed.

AI-assisted change.

Case and evidence


Made by Perfloop. Human sponsor: Tomás Senart. To ask for a change, comment or review in plain words. How Perfloop handles pull requests.

@milosgajdos

Copy link
Copy Markdown
Member

@perfloop-agent squash your commits

A resumed PATCH closes its writer while constructing the continuation response and again during deferred cleanup. Once both the checkpoint and the driver close have succeeded, later closes need not serialize and store the same digest again.

Keep calling the driver to preserve its close result and cleanup behavior. Failed closes remain retryable, and resumed uploads get a fresh writer. Bypass checkpoint tracking when digest resumption is disabled.

Signed-off-by: Perfloop Agent <[email protected]>
Signed-off-by: Tomás Senart <[email protected]>
@perfloop-agent
perfloop-agent force-pushed the perfloop-pr-open-wajdw4m375 branch from 1e085e3 to 6af19ae Compare November 11, 2026 14:15
@milosgajdos
milosgajdos merged commit dfb3dea 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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants