[r3.4] [3/3] cmd/utils: add --only-history flag to rm-state command (cherry-pick #20899)#21118
Merged
awskii merged 2 commits intoMay 11, 2026
Conversation
## Summary - Show KEEP/REMOVE markers and file sizes on commitment files **before** prompting (was shown after) - Print `Datadir:` and `Step range:` header for context - Pre-compute and display total file count and estimated deletion size in prompt (`remove 38 files (~15.2GB)?`) - Drop misleading `Total:` line that only summed commitment files ### Before ``` Snapshot dir: /erigon-data/hoodi-tmp/snapshots/domain v2.0-commitment.0-32.kv Unwindable v2.0-commitment.32-48.kv Unwindable v2.0-commitment.48-56.kv Unwindable v2.0-commitment.56-60.kv Unwindable remove latest snapshot files (stepFrom>=56) and files ending at stepTo=60? 1) RemoveFile 4) Exit (pick number): 4 ``` ### After ``` Datadir: /erigon-data/hoodi-tmp Step range: latest (stepFrom>=56) KEEP v2.0-commitment.0-32.kv (11.8GB) Unwindable KEEP v2.0-commitment.32-48.kv (8.1GB) Unwindable KEEP v2.0-commitment.48-56.kv (4.2GB) Unwindable REMOVE v2.0-commitment.56-60.kv (3.0GB) Unwindable remove 44 files (~9.7GB)? 1) RemoveFile 4) Exit (pick number): ``` (cherry picked from commit ef56c9b)
Adds `--only-history` (alias `--history`) to `erigon seg rm-state`. When set, restricts deletion to history files (`SnapHistory` + `SnapIdx`) only — leaving domain data (`.kv` files in `SnapDomain`, accessor files) untouched. Useful when combined with `--step from-to` to prune old history without touching domain snapshots. (cherry picked from commit e4ed80c)
Base automatically changed from
cherry-pick-20525-to-release-3.4
to
cherry-pick-20202-to-release-3.4
May 11, 2026 22:12
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Cherry-pick of #20899 to release/3.4.
Stacked on #21117 (cherry-pick of #20525). Merge order: 1/3 (#21116) → 2/3 (#21117) → this. Change base to
release/3.4after 2/3 lands.