Skip to content

[performance] cp commitment rebuild relevant PRs#21095

Merged
AskAlexSharov merged 3 commits into
performancefrom
cherry-pick/20939-21023-21025-21026-21029-to-performance
May 11, 2026
Merged

[performance] cp commitment rebuild relevant PRs#21095
AskAlexSharov merged 3 commits into
performancefrom
cherry-pick/20939-21023-21025-21026-21029-to-performance

Conversation

@sudeepdino008
Copy link
Copy Markdown
Member

…#20939)

- `--resume` already supported with history commitment rebuild
…g retire (#21023)

## Summary
- In `seg retire`, `BuildFiles` can leave background build/merge
goroutines running. If `MergeLoop` runs while one of those is still in
flight, its `mergingFiles` CAS loses to the background merge and
`MergeLoop` returns immediately without doing anything.
- The next MergeLoop is typically skipped because an earlier one is
running. And so the whole merge logic was being skipped.
- Drain background work via `agg.WaitForFiles()` between
`BuildFiles`/prune and `MergeLoop` so the merge step actually runs.

## Test plan
- [ ] `make lint` passes
- [ ] `make erigon` builds
- [ ] Run `erigon seg retire` on a datadir where background build/merge
is active and confirm `MergeLoop` performs merges (previously a no-op)
## Summary
- Filter `.kv` files before slicing in `CheckCommitmentRoot`, so
`onlyCheckLastFile` picks the latest `.kv` instead of whatever
`aggTx.Files` returned last (which was often the `.ef`).
- Default `CHECK_COMMITMENT_ROOT_ONLY_LAST_FILE` and
`CHECK_COMMITMENT_ROOT_ONLY_LAST_FILE_RECOMPUTE` to `false` so the check
now covers all `.kv` files by default.
- Add a discovery log line and a clearer warning when no `.kv` files are
present.
- with #21026 -- recompute
check works fine now; and it is fast enough to do for all kv files

## Test plan
- [ ] `make lint`
- [ ] `make erigon integration`
- [ ] Run `erigon seg integrity --check=CommitmentRoot` against a
datadir and confirm all `.kv` files get checked.
@sudeepdino008 sudeepdino008 changed the title cherry-pick #20939, #21023, #21029 to performance [performance] cherry-pick commitment rebuild relevant PRs May 11, 2026
@sudeepdino008 sudeepdino008 requested a review from wmitsuda May 11, 2026 04:24
@sudeepdino008 sudeepdino008 changed the title [performance] cherry-pick commitment rebuild relevant PRs [performance] cpcommitment rebuild relevant PRs May 11, 2026
@sudeepdino008 sudeepdino008 changed the title [performance] cpcommitment rebuild relevant PRs [performance] cp commitment rebuild relevant PRs May 11, 2026
@AskAlexSharov AskAlexSharov enabled auto-merge (squash) May 11, 2026 04:34
@AskAlexSharov AskAlexSharov merged commit 5479a4d into performance May 11, 2026
36 checks passed
@AskAlexSharov AskAlexSharov deleted the cherry-pick/20939-21023-21025-21026-21029-to-performance branch May 11, 2026 05:00
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