Repository navigation
fix: roll active segment before retention - #4781
Open
ParthibanRajasekaran wants to merge 7 commits into
Open
ParthibanRajasekaran wants to merge 7 commits into
ParthibanRajasekaran wants to merge 7 commits into
Conversation
|
Thanks for the PR. It is labeled If AI assistance was used to create this PR, you are required to run the Slash commands (own line, regular comment) move it around the queue:
See CONTRIBUTING.md for details. |
Codecov Report❌ Patch coverage is
❌ Your patch check has failed because the patch coverage (15.92%) is below the target coverage (50.00%). You can increase the patch coverage or adjust the target coverage. Additional details and impacted files@@ Coverage Diff @@
## master #4781 +/- ##
============================================
- Coverage 90.89% 90.87% -0.03%
Complexity 3878 3878
============================================
Files 1564 1564
Lines 407450 407552 +102
Branches 341308 341411 +103
============================================
- Hits 370368 370366 -2
- Misses 29706 29782 +76
- Partials 7376 7404 +28
🚀 New features to boost your workflow:
|
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Which issue does this PR address?
Closes #4650
Rationale
Idle partitions can retain expired or over-budget data because their active segment is never sealed. Retention cannot remove the active segment, so cleanup remains blocked until another write triggers rotation.
What changed?
The cleaner now asks the partition primary to replicate a
RollSegmentoperation when a non-empty active segment would become eligible for retention after sealing. The operation is applied at the committed log position and rotates the segment consistently across replicas before the existing cleanup pass runs. Empty active segments are not rolled.Local Execution
cargo fmt --allcargo check -p partitions -p servercargo test -p partitions --lib(731 passed, 3 ignored)cargo test -p server segment_cleaner --lib(3 passed)prekwas not installed