Skip to content

fix(dvcr): importer#2511

Draft
universal-itengineer wants to merge 3 commits into
mainfrom
fix/dvcr/importer
Draft

fix(dvcr): importer#2511
universal-itengineer wants to merge 3 commits into
mainfrom
fix/dvcr/importer

Conversation

@universal-itengineer

Copy link
Copy Markdown
Member

Description

Why do we need it, and what problem does it solve?

What is the expected result?

Checklist

  • The code is covered by unit tests.
  • e2e tests passed.
  • Documentation updated according to the changes.
  • Changes were tested in the Kubernetes cluster manually.

Changelog entries

section:
type:
summary:

Wire sourceImageSize through inspectAndStreamSourceImage into getImageInfo. The parameter will be used in a follow-up commit to skip the redundant full-stream drain for raw/iso/qcow2 formats.

Signed-off-by: Nikita Korolev <nikita.korolev@flant.com>
…/iso/raw

Previously getImageInfoStandard always drained the entire source stream into io.Discard after running qemu-img info on the first 64 MiB. Combined with the blocking io.TeeReader in inspectAndStreamSourceImage, that throttled the main DVCR upload to ~4 MB/s on large (~5 GB) Windows images.

The drain is redundant for plain (non-archived) inputs:

- qcow2: VirtualSize is already populated by qemu-img info from the 64 MiB temp file;

- iso/raw: virtual size equals the on-wire source size (sourceImageSize).

Drain is preserved for archived formats (gz/xz/zst) where the uncompressed size must still be computed from the stream.

Signed-off-by: Nikita Korolev <nikita.korolev@flant.com>
Replace io.TeeReader in inspectAndStreamSourceImage with a small non-blocking variant. Once the inspect side finishes and closes its end of the pipe, the writer is marked done and subsequent reads bypass it entirely, so a slow or closed inspect consumer can no longer back-pressure the main upload stream.

The Write error from the inspect side is intentionally swallowed: the inspect pipe is best-effort and must never fail the upload.

Together with the previous commit that removes the redundant full-stream drain, this restores DVCR import throughput to network speed for large qcow2/iso/raw images.

Signed-off-by: Nikita Korolev <nikita.korolev@flant.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant