-
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.MaybeAdvanceEpoch helper #3709
Conversation
5261d99
to
2844f78
Compare
internal/epoch/epoch_manager_test.go
Outdated
@@ -529,6 +529,74 @@ func TestSlowWrite_MovesToNextEpochTwice(t *testing.T) { | |||
require.Contains(t, err.Error(), "slow index write") | |||
} | |||
|
|||
func TestMabyeAdvanceEpochEmpty(t *testing.T) { |
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.
Tests not originally in #3651
@@ -723,6 +723,25 @@ func (e *Manager) refreshAttemptLocked(ctx context.Context) error { | |||
return nil | |||
} | |||
|
|||
// MaybeAdvanceWriteEpoch writes a new write epoch marker when a new write | |||
// epoch should be started, otherwise it does not do anything. | |||
func (e *Manager) MaybeAdvanceWriteEpoch(ctx context.Context) error { |
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.
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #3709 +/- ##
==========================================
+ Coverage 75.86% 77.03% +1.16%
==========================================
Files 470 476 +6
Lines 37301 28753 -8548
==========================================
- Hits 28299 22150 -6149
+ Misses 7071 4675 -2396
+ Partials 1931 1928 -3 ☔ View full report in Codecov by Sentry. |
2844f78
to
ecccceb
Compare
ecccceb
to
67844e6
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
…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
Adds
epoch.Manager.MaybeAdvanceEpoch helper
and tests.The helper is not yet invoked in maintenance, a separate change
will add all the epoch management cleanup tasks to maintenance.
Ref: