-
Notifications
You must be signed in to change notification settings - Fork 594
feat(general): add stats to maintenance run - CleanupMarkers #4900
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
Conversation
7dc6b32 to
3be87e1
Compare
3be87e1 to
d6efee9
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR adds observability statistics for the CleanupMarkers maintenance task to track the number of epoch markers and deletion watermarks removed during cleanup operations.
Key Changes:
- Introduced
CleanupMarkersStatsstruct to capture deletion counts for epoch markers and watermarks - Modified
CleanupMarkersfunction to return statistics instead of just error - Added helper functions
BuildExtraandBuildFromExtrafor serializing/deserializing stats
Reviewed Changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| repo/maintenancestats/types.go | Implements CleanupMarkersStats type with serialization, summary generation, and builder functions |
| repo/maintenancestats/types_test.go | Adds comprehensive test coverage for stats serialization/deserialization |
| internal/epoch/epoch_manager.go | Updates CleanupMarkers and helper functions to track and return deletion counts |
| internal/epoch/epoch_manager_test.go | Updates tests to verify returned statistics |
| repo/maintenance/maintenance_run.go | Captures and propagates stats from CleanupMarkers |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
repo/maintenancestats/types.go
Outdated
| DeletedEpochMarkerBlobs int `json:"deletedEpochMarkerBlobs"` | ||
| DeletedDeletionWaterMarkBlobs int `json:"deletedDeletionWaterMarkBlobs"` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| DeletedEpochMarkerBlobs int `json:"deletedEpochMarkerBlobs"` | |
| DeletedDeletionWaterMarkBlobs int `json:"deletedDeletionWaterMarkBlobs"` | |
| DeletedEpochMarkerBlobCount int `json:"deletedEpochMarkerBlobCount"` | |
| DeletedWatermarkBlobCount int `json:"deletedWatermarkBlobCount"` | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
DeletedWatermarkBlobCount was not renamed correctly
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #4900 +/- ##
==========================================
+ Coverage 75.86% 78.04% +2.17%
==========================================
Files 470 538 +68
Lines 37301 31235 -6066
==========================================
- Hits 28299 24376 -3923
+ Misses 7071 4818 -2253
- Partials 1931 2041 +110 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
2b4a140 to
449932a
Compare
449932a to
c5d74ac
Compare
| // CleanupMarkersStats are the stats for cleaning up markers. | ||
| type CleanupMarkersStats struct { | ||
| DeletedEpochMarkerBlobCount int `json:"deletedEpochMarkerBlobCount"` | ||
| DeletedDeletionWaterMarkBlobCount int `json:"deletedDeletionWaterMarkBlobCount"` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
From a prior comment, this can be shortened:
| DeletedDeletionWaterMarkBlobCount int `json:"deletedDeletionWaterMarkBlobCount"` | |
| DeletedWaterMarkBlobCount int `json:"deletedWaterMarkBlobCount"` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's merge this PR as is. A followup PR will address the naming of these fields.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- field naming addressed in fix(general): field and variable names #4911
Maintenance is critical for healthy of the repository.
On the other hand, Maintenance is complex, because it runs multiple sub tasks each may generate different results according to the maintenance policy. The results may include deleting/combining/adding data/metadata to the repository.
It is worthy to add more observability for these tasks for below reasons:
There will be a serial of PRs to add observability info for each sub task.
The current PR add the stats info for CleanupMarkers sub task.