-
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): perform index compaction during repo maintenance #3651
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #3651 +/- ##
==========================================
+ Coverage 75.86% 77.09% +1.22%
==========================================
Files 470 476 +6
Lines 37301 28902 -8399
==========================================
- Hits 28299 22281 -6018
+ Misses 7071 4693 -2378
+ Partials 1931 1928 -3 ☔ View full report in Codecov by Sentry. |
c133f9a
to
d1d670f
Compare
TaskIndexCompaction = "index-compaction" | ||
TaskExtendBlobRetentionTimeFull = "extend-blob-retention-time" | ||
TaskCleanupLogs = "cleanup-logs" | ||
TaskEpochDeleteSupersededIndexes = "delete-superseded-epoch-indexes" |
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.
Other "epoch" cleanup tasks are added as well
internal/epoch/epoch_manager.go
Outdated
@@ -593,19 +593,28 @@ func (e *Manager) loadSingleEpochCompactions(ctx context.Context, cs *CurrentSna | |||
return nil | |||
} | |||
|
|||
func (e *Manager) maybeGenerateNextRangeCheckpointAsync(ctx context.Context, cs CurrentSnapshot, p *Parameters) { | |||
func getRangeToCompact(cs CurrentSnapshot, p Parameters) (low, high int, compactRange bool) { |
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.
This is "factored out" from maybeGenerateNextRangeCheckpointAsync
It is reused.
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.
Left a few questions, but otherwise it makes sense to me. Reviewing commit-by-commit was very helpful, thanks
Extracted from kopia#3651. Thanks to @plar and @redgoat650 for the suggestions. Ref: - kopia#3603 - kopia#3645 - kopia#3638 - kopia#3639
a9e21c7
to
ab2c592
Compare
Add: - epoch.Manager.MaybeCompactSingleEpoch - getCompactedEpochRange helper - oldestUncompactedEpoch helper - TestOldestUncompactedEpoch - Tests for MaybeCompactSingleEpoch Ref: - Subset and dependency of #3651 - Depends on #3735 - Avoid index (epoch) cleanup and compaction during index reads #3638 - Make "read" commands/operations really read-only. #3639
ab2c592
to
0b1d208
Compare
0b1d208
to
f95d675
Compare
f95d675
to
1115325
Compare
1115325
to
9f33ef8
Compare
9f33ef8
to
f4b88af
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.
Looks good
|
||
// compact range | ||
if err := ReportRun(ctx, runParams.rep, TaskEpochGenerateRange, s, func() error { | ||
log(ctx).Infof("Attempting to compact a range of epoch indexes ...") |
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.
super nit: the other similar info logs have no space before the ellipsis. Remove for consistency?
log(ctx).Infof("Attempting to compact a range of epoch indexes ...") | |
log(ctx).Infof("Attempting to compact a range of epoch indexes...") |
…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
Perform index epoch compaction and cleanup during repository maintenance.
Ref:
Followup to:
Related helpers and changes: