Skip to content

cmd: improve commitment snapshot removal output#20202

Merged
awskii merged 1 commit into
mainfrom
awskii/snap-output-fix
Mar 30, 2026
Merged

cmd: improve commitment snapshot removal output#20202
awskii merged 1 commit into
mainfrom
awskii/snap-output-fix

Conversation

@awskii

@awskii awskii commented Mar 27, 2026

Copy link
Copy Markdown
Member

Summary

Improves output formatting for the commitment snapshot removal command:

  • Path once: prints snapshot directory path once at top, then filenames only
  • Unwindable status: replaces found state key with kviUnwindable and found state key using btNot Unwindable (*)
  • Newline before removal list for readability
  • File sizes: shows per-file size and total using common.ByteCount

Before

found state key with kvi /path/to/snapshots/domain/v2.0-commitment.112-128.kv
found state key with kvi /path/to/snapshots/domain/v2.0-commitment.16-32.kv
REMOVE /path/to/snapshots/domain/v2.0-commitment.0-16.kv
...

After

Snapshot dir: /path/to/snapshots/domain/
  v2.0-commitment.112-128.kv  Unwindable
  v2.0-commitment.16-32.kv    Unwindable

  REMOVE v2.0-commitment.0-16.kv     (1.2 GiB)
  REMOVE v2.0-commitment.112-128.kv  (1.1 GiB)
  Total: 9.4 GiB

Co-authored-by: shuo shuo@erigon.dev

@awskii awskii force-pushed the awskii/snap-output-fix branch from aaff970 to 11d47b4 Compare March 27, 2026 19:14
@awskii awskii requested review from mh0lt and sudeepdino008 March 27, 2026 19:15
…le status, file sizes

Co-authored-by: shuo <shuo@erigon.dev>
@awskii awskii force-pushed the awskii/snap-output-fix branch from 11d47b4 to 20e366f Compare March 27, 2026 20:17
@awskii awskii added this pull request to the merge queue Mar 30, 2026
Merged via the queue into main with commit c286488 Mar 30, 2026
35 checks passed
@awskii awskii deleted the awskii/snap-output-fix branch March 30, 2026 08:12
yperbasis pushed a commit that referenced this pull request Mar 31, 2026
## Summary

Improves output formatting for the commitment snapshot removal command:

- **Path once**: prints snapshot directory path once at top, then
filenames only
- **Unwindable status**: replaces `found state key with kvi` →
`Unwindable` and `found state key using bt` → `Not Unwindable (*)`
- **Newline before removal list** for readability
- **File sizes**: shows per-file size and total using `common.ByteCount`

## Before
```
found state key with kvi /path/to/snapshots/domain/v2.0-commitment.112-128.kv
found state key with kvi /path/to/snapshots/domain/v2.0-commitment.16-32.kv
REMOVE /path/to/snapshots/domain/v2.0-commitment.0-16.kv
...
```

## After
```
Snapshot dir: /path/to/snapshots/domain/
  v2.0-commitment.112-128.kv  Unwindable
  v2.0-commitment.16-32.kv    Unwindable

  REMOVE v2.0-commitment.0-16.kv     (1.2 GiB)
  REMOVE v2.0-commitment.112-128.kv  (1.1 GiB)
  Total: 9.4 GiB
```

Co-authored-by: shuo <shuo@erigon.dev>

Co-authored-by: shuo <shuo@erigon.dev>
awskii added a commit that referenced this pull request May 11, 2026
…ick #20525) (#21117)

Cherry-pick of #20525 to release/3.4.

Stacked on #21116 (cherry-pick of #20202). Merge order: 1/3 first, then
this. Change base to `release/3.4` after 1/3 lands.
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.

2 participants