Skip to content

pruner: prune loop spins holding checkpointMu when a whole batch fails #5275

Description

@FlashWayne

Version: main (3b16e0d)

pruner.Service.prune keeps fetching batches of maxHeadersPerLoop headers until a batch is shorter than that. If every header in a full batch fails to prune (e.g. a disk or datastore error), lastPrunedHeader doesn't move, the next iteration fetches the same headers again, and the loop spins without any delay while holding checkpointMu.

While it spins, it rewrites the checkpoint on every iteration and blocks pruneOnHeaderDelete (and so the header store's DeleteRange during syncer tail moves) and the pruner metrics callback, until the fault clears or the node stops.

Expected: the round ends when a batch makes no progress, and the failed heights are retried on the next cycle.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions