segment ring for fair pruning #7343
Labels
A-pruning
Related to pruning or full node
C-enhancement
New feature or request
M-prevent-stale
Prevents old inactive issues/PRs from being closed due to inactivity
Describe the feature
Segment pruning always starts with the same segment. Last segments in the iterator, risk not being pruned if the prune limit is small so it's often reached before pruning is done. We should implement a ring here: add a field to
Pruner
where we save the index in the chained segments iterator, of the last pruned segment. Upon callingprune_segments
next time, the iterator should skip until the saved index + 1.reth/crates/prune/src/pruner.rs
Lines 141 to 145 in c04dbe6
This will probably require modifying
static_file_segments
method, since it's important that no segments that need pruning are dropped when the iterator skips ahead to the last pruned segment.reth/crates/prune/src/pruner.rs
Lines 215 to 243 in c04dbe6
Additional context
No response
The text was updated successfully, but these errors were encountered: