Skip to content

[snapshot] show completion marks in transfer progress - #497

Merged
ldmonster merged 1 commit into
mainfrom
fix/snapshot-progress-completion-marks
Oct 1, 2026
Merged

ldmonster merged 1 commit into
mainfrom
fix/snapshot-progress-completion-marks

Conversation

@kkozoriz

@kkozoriz kkozoriz commented Sep 30, 2026 •

Copy link
Copy Markdown
Contributor

Description

In a terminal, d8 snapshot download and upload now mark every volume row and the "N/M volumes" summary with ✓ (done) or ✗ (interrupted), and the summary verb follows the direction ("uploaded" for upload). Non-terminal output is unchanged.

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

After a run the last spinner frame stayed on screen, which looks like a hang; nothing said whether a volume finished or was interrupted; and upload reported itself as "downloaded".

What is the expected result?

download, final frame. Before (v0.33.23):

 3/3 volumes downloaded ⠴
PersistentVolumeClaim/blk-1    Download complete
PersistentVolumeClaim/fs-1     Download complete
PersistentVolumeClaim/blk-2    Download complete

After:

 3/3 volumes downloaded ✓
PersistentVolumeClaim/fs-1  ✓  Download complete
PersistentVolumeClaim/blk-2 ✓  Download complete
PersistentVolumeClaim/blk-1 ✓  Download complete

upload, final frame. Before (v0.33.23) — note "downloaded":

 3/3 volumes downloaded ⠋
PersistentVolumeClaim/blk-1    Upload complete
PersistentVolumeClaim/blk-2    Upload complete
PersistentVolumeClaim/fs-1     Upload complete

After:

 3/3 volumes uploaded ✓
PersistentVolumeClaim/fs-1  ✓  Upload complete
PersistentVolumeClaim/blk-1 ✓  Upload complete
PersistentVolumeClaim/blk-2 ✓  Upload complete

Mid-transfer (finished rows show ✓, running rows keep the spinner):

 2/3 volumes downloaded ⠧
PersistentVolumeClaim/fs-1  ✓  Download complete
PersistentVolumeClaim/blk-2 ⠧  Downloading       [================>         ]  2.6 GiB / 4.0 GiB 65%
PersistentVolumeClaim/blk-1 ✓  Download complete

Interrupted with Ctrl-C:

 0/3 volumes downloaded ✗
PersistentVolumeClaim/fs-1  ✗  Interrupted
PersistentVolumeClaim/blk-2 ✗  Interrupted
PersistentVolumeClaim/blk-1 ✗  Interrupted
Error executing command: snapshot download failed: context canceled

Interrupted with Ctrl-C while volumes are in flight (one volume had finished; a row still finalizing at 100% counts as interrupted). The summary follows the volume count, not the exit status:

 1/3 volumes downloaded ✗
PersistentVolumeClaim/fs-1  ✗  Interrupted
PersistentVolumeClaim/blk-2 ✗  Interrupted
PersistentVolumeClaim/blk-1 ✓  Download complete
Error executing command: snapshot download failed: context canceled

The same for upload:

 1/3 volumes uploaded ✗
PersistentVolumeClaim/blk-2 ✗  Interrupted
PersistentVolumeClaim/blk-1 ✓  Upload complete
PersistentVolumeClaim/fs-1  ✗  Interrupted
Error executing command: snapshot upload failed: import volume data for VolumeSnapshot/…: context canceled

Repeated download into the same directory:

 3/3 volumes downloaded ✓
PersistentVolumeClaim/fs-1  ✓  Already exists
PersistentVolumeClaim/blk-2 ✓  Already exists
PersistentVolumeClaim/blk-1 ✓  Already exists

Verified

Real cluster (Deckhouse v1.78.0, local thin LVM; two Block volumes of 0.7 and 3 GiB and one Filesystem volume of 1.5 GiB, about 5.2 GiB of real data), run in a real terminal (tmux). "After" is a binary built from the PR commit b4350ede0 (clean tree, d8 version local-dev, sha256 b9375ec8…); "before" is the released v0.33.23.

  • download: ✓ on all 3 rows and on the summary; repeated into the same directory, every row shows ✓ Already exists and the summary 3/3 ✓.
  • Ctrl-C during the transfer, download and upload: the finished volume keeps its ✓, the rest show ✗ Interrupted, the summary shows 1/3 … ✗; Ctrl-C before any volume finished gives 0/3 ✗.
  • upload of the same archive into a clean namespace: 3/3 volumes uploaded ✓; the released v0.33.23 on the same archive prints 3/3 volumes downloaded ⠋.
  • Non-terminal output (stdout redirected to a file), v0.33.23 vs this build: download 320 vs 323 lines, upload 111 vs 106 lines; no ✓, ✗ or spinner characters in either, and after masking sizes, paths and timestamps the only differences are timing noise (one extra 0/3 progress line, DataExport ids). Both builds print uploaded … in the upload aggregate line.
  • CLI surface unchanged: d8 snapshot <sub> --help is byte-identical to v0.33.23 for all 8 subcommands, and the exit code is 1 in both for a missing argument, a missing snapshot and a missing archive directory.
  • go test ./internal/snapshot/progress/ ./internal/snapshot/cmd/download/ — both packages ok.

Checklist

  • The code is covered by unit tests. (progress/multibar_test.go, cmd/download/download_test.go; both packages pass)
  • e2e tests passed. (there is no e2e suite for terminal rendering; checked by hand on a cluster, see Verified)
  • Documentation updated according to the changes. (not applicable: cosmetic output change, no flags or formats changed)
  • Changes were tested in the Kubernetes cluster manually. (see Verified)

Screenshots

Before:

Снимок экрана — 2026-09-30 в 16 31 27

After:

Снимок экрана — 2026-09-30 в 16 34 26 Снимок экрана — 2026-09-30 в 16 34 52

@kkozoriz kkozoriz self-assigned this Sep 30, 2026
@kkozoriz
kkozoriz marked this pull request as ready for review October 1, 2026 10:51
@kkozoriz
kkozoriz requested a review from ldmonster as a code owner October 1, 2026 10:51
@kkozoriz
kkozoriz force-pushed the fix/snapshot-progress-completion-marks branch from b4350ed to 1366977 Compare October 1, 2026 11:18
In a terminal, the "N/M volumes" summary of `d8 snapshot download` and
`upload` left a frozen spinner frame on screen after every exit, volume
rows showed no outcome, and upload said "volumes downloaded".

- Volume rows spin while waiting and while transferring, then show
  a check mark (complete / already exists) or a ballot X (interrupted).
- The summary line shows a check mark when all volumes finished and a
  ballot X otherwise; it follows the volume count, not the exit status.
- The summary verb follows the direction ("uploaded" for upload).
- Non-terminal output is unchanged.

Signed-off-by: Konstantin Kozoriz <konstantin.kozoriz@flant.com>
@kkozoriz
kkozoriz force-pushed the fix/snapshot-progress-completion-marks branch from 1366977 to 5c313ca Compare October 1, 2026 17:43
@ldmonster ldmonster added the enhancement New feature or request label Oct 1, 2026
@ldmonster
ldmonster merged commit 765f232 into main Oct 1, 2026
6 of 7 checks passed
@ldmonster
ldmonster deleted the fix/snapshot-progress-completion-marks branch October 1, 2026 17:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants