Skip to content
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

Merged
merged 6 commits into from
Mar 7, 2024

Conversation

julio-lopez
Copy link
Collaborator

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:

@@ -529,6 +529,74 @@ func TestSlowWrite_MovesToNextEpochTwice(t *testing.T) {
require.Contains(t, err.Error(), "slow index write")
}

func TestMabyeAdvanceEpochEmpty(t *testing.T) {
Copy link
Collaborator Author

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 {
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link

codecov bot commented Mar 7, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 77.03%. Comparing base (cb455c6) to head (67844e6).
Report is 45 commits behind head on master.

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.
📢 Have feedback on the report? Share it here.

@julio-lopez julio-lopez marked this pull request as ready for review March 7, 2024 00:54
Copy link
Contributor

@redgoat650 redgoat650 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@julio-lopez julio-lopez merged commit be49fcd into kopia:master Mar 7, 2024
27 checks passed
@julio-lopez julio-lopez deleted the feat/maybe-advance-epoch branch March 7, 2024 01:12
julio-lopez added a commit that referenced this pull request Mar 27, 2024
…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
Lyndon-Li pushed a commit to Lyndon-Li/kopia that referenced this pull request Mar 29, 2024
…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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants