feat: add --prioritize-fullness flag to undo-upmaps command #62
+330
−8
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.
Summary
Add opt-in OSD utilization (fullness) consideration to the
undo-upmapscommand via the--prioritize-fullnessflag. When enabled, the tool selects PGs to undo based on a composite score combining OSD fullness and backfill load, with fullness as the primary factor.Motivation
After swap-bucket operations or in clusters with uneven disk utilization, it's often desirable to prioritize data movement based on OSD fullness rather than just backfill load. This allows operators to preferentially drain fuller OSDs or fill emptier ones, helping to rebalance storage utilization more effectively.
Key Features
score = (backfillWeight * backfillScore) + (fullnessWeight * fullnessScore)--targetflag: prioritizes removing PGs from fuller OSDs--target: prioritizes moving PGs to emptier OSDsImplementation Details
osdBackfillState.utilizationfield to track OSD fullnessosdDf()function inceph.gowith caching supportremapLeastBusyPg()to acceptscoreSourceandpreferFullerparameters for flexible scoringExample Usage
After a swap-bucket operation, prioritize draining the fuller OSDs:
With
--targetflag, bring data back from the fullest OSDs:Testing
All existing tests pass, and new tests cover:
$ go test -v PASS ok github.com/digitalocean/pgremapper 0.360sDocumentation
Co-Authored-By: Claude Sonnet 4.5 noreply@anthropic.com