-
Notifications
You must be signed in to change notification settings - Fork 343
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
refactor(general): add epoch.Manager.MaybeCompactSingleEpoch #3728
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #3728 +/- ##
==========================================
+ Coverage 75.86% 77.10% +1.23%
==========================================
Files 470 476 +6
Lines 37301 28837 -8464
==========================================
- Hits 28299 22234 -6065
+ Misses 7071 4678 -2393
+ Partials 1931 1925 -6 ☔ View full report in Codecov by Sentry. |
cc654d9
to
303da76
Compare
303da76
to
077d3ab
Compare
Refactoring for the original implementation with intRange and getKeyRange from closed-open ranges [lo, hi) to closed ranges: [lo, hi]. The primary motivation is for consistency with the implementation of epoch.RangeMetadata in the same package, and thus avoid confusion and reduce cognitive load. Changes: - adds a getContiguousKeyRange wrapper that checks for contiguity. - getKeyRange simply returns a range with minimum and maximum values for the keys in the map. - changes the range implementation from closed-open ranges [lo, hi) to closed ranges: [lo, hi] where both lo and hi are included in the range. - Additional unit tests are included. - renames intRange to closedIntRange to reflect new functionality. Ref: - Follow up refactor(general): add epoch.getKeyRange helper #3721 - Needed for refactor(general): add epoch.Manager.MaybeCompactSingleEpoch #3728 - Avoid index (epoch) cleanup and compaction during index reads #3638
077d3ab
to
d249ac4
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.
LGTM
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.
Some comment nits and a question, but looks good
return err | ||
} | ||
|
||
if !cs.isSettledEpochNumber(uncompacted) { |
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.
So if I'm not mistaken, this has to do with the ordering of compaction vs epoch advancement we discussed, right? I.e. if we only advance epoch after successful compaction we only ever expect compaction-eligible epochs to be within the unsettled range.
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.
@redgoat650 Yes, it's related. See the check right below.
In short, the current snapshot cs
only loads the last 3 uncompacted epochs, that is, the current write epoch, and the previous 2. So, there may be some uncompacted epochs for which the blob metadata is not included in cs
. The block below accounts for that and explicitly loads the list of the blobs for the "missing epochs".
a796c75
to
432fab0
Compare
…3651) Perform index epoch compaction and cleanup during repository maintenance * refactor: rename maintenance task for deleting superseded indexes * maintenance task to cleanup epoch markers * maintenance task to advance write index epoch * maintenance task to compact epoch ranges * quick maintenance task to compact a single (index) epoch * full maintenance task to compact a single (index) epoch Ref: - #3638 - #3639 Followup to: - #3603 - #3645 Related helpers and changes: - #3721 - #3735 - #3709 - #3728 - #3727 - #3726
…opia#3651) Perform index epoch compaction and cleanup during repository maintenance * refactor: rename maintenance task for deleting superseded indexes * maintenance task to cleanup epoch markers * maintenance task to advance write index epoch * maintenance task to compact epoch ranges * quick maintenance task to compact a single (index) epoch * full maintenance task to compact a single (index) epoch Ref: - kopia#3638 - kopia#3639 Followup to: - kopia#3603 - kopia#3645 Related helpers and changes: - kopia#3721 - kopia#3735 - kopia#3709 - kopia#3728 - kopia#3727 - kopia#3726
Subset and dependency of #3651
Depends on #3735
Ref: