Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make ImpactedBlocks an absolute range #1685

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

mkeeter
Copy link
Contributor

@mkeeter mkeeter commented Mar 18, 2025

The current implementation of ImpactedBlocks stores an inclusive range of ImpactedAddr, which are themselves (ExtentId, BlockOffset) tuples. This makes life awkward, because we don't know how to step through a range of ImpactedBlocks without knowing the blocks-per-extent count: is (ExtentId(0), BlockOffset(7)) adjacent to (ExtentId(1), BlockOffset(0))? Without additional information, there's no way of knowing!

This ambiguity adds a bunch of boilerplate, and specifically complicates the implementation of ActiveJobs.

The only time when we actually need the extent ID is when doing live-repair activities, which forgo the block abstraction and care about individual extent files. It makes much more sense to have ImpactedBlocks be an absolute block range (using BlockIndex instead of BlockOffset), then tweak the small number of sites which care about extents. These sites are:

  • Downstairs::reserve_repair_ids_for_extent
  • Downstairs::get_repair_ids
  • Downstairs::check_repair_ids_for_range
  • ActiveJobs::deps_for_repair
  • ImpactedBlocks::extents

faithanalog added a commit that referenced this pull request Mar 19, 2025
Only remaining usage after #1685 was for tests, in precisely one function.
Now that's gone, and the tests don't do unnecessary conversions between
(extent, block) and absolute address anymore.
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