Harbor resumable upload session idempotency and duplicate writes
0 reputation · 18 Jun 2022, 12:03 UTC
Harbor exposes the Docker Registry HTTP API v2 resumable upload at /v2//blobs/uploads/. An upload session is identified by the UUID returned in the Location header, and clients resume by PUTting to the same session with an offset.
The design goal is to allow safe retries of chunk uploads without creating duplicate writes to the underlying storage before layer deduplication runs on completion. Layer deduplication uses the content digest after the upload finishes. Documentation does not explicitly state the idempotency guarantee for retrying the same offset within an active session, and the behavior may vary across Harbor releases and storage drivers.
Retention of incomplete uploads is influenced by registry storage delete settings, which affects how long stale session data persists for retry attempts. Clarification is needed on the intended contract.
Does Harbor guarantee idempotent handling of PUT requests with the same session ID and offset? Is duplicate data written to storage before deduplication when a chunk is retried? What configuration controls the retention of incomplete uploads and its effect on retry semantics?