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

Draft: perform index maintenance on repo maintenance #534

Conversation

julio-lopez
Copy link

@julio-lopez julio-lopez commented Dec 20, 2023

Early draft with partial implementation

  • Cleanup watermark and epoch markers on full maintenance
  • Advance epoch on quick maintenance
  • Advance epoch on full maintenance
  • Compact a single epoch on quick maintenance
  • Range compaction on full maintenance
  • Epoch compaction for all elegible epochs on full maintenance

Comment on lines +789 to +794

if shouldAdvance(cs.UncompactedEpochSets[cs.WriteEpoch], p.MinEpochDuration, p.EpochAdvanceOnCountThreshold, p.EpochAdvanceOnTotalSizeBytesThreshold) {
return errors.Wrap(e.advanceEpochMarker(ctx, cs), "error advancing epoch")
}

Choose a reason for hiding this comment

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

I don't recall this 100%, did we decide that we should advance epoch during maintenance only or that will continue to happen during index loads on write connection ?

In other words, with this change e.allowWrites() will skip epoch advance here by-default now since allowWrites() is going to be returning false always until someone overrides the index manager config from CLI.

Choose a reason for hiding this comment

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

And I just noticed that MaybeAdvanceWriteEpoch() is exposed to be called from maintenance only. That makes sense, but what if maintenance is enabled and e.allowWrites() returns false ? Would that ever happen, if not is that check needed ?

Copy link
Author

Choose a reason for hiding this comment

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

good catch, changed.

@julio-lopez julio-lopez force-pushed the draft/index-maintenance branch 2 times, most recently from fdd22fe to 19f504d Compare February 7, 2024 06:49
@julio-lopez julio-lopez force-pushed the draft/no-index-cleanup-on-load branch 3 times, most recently from d4a7004 to 84da027 Compare February 13, 2024 00:40
@julio-lopez julio-lopez changed the base branch from draft/no-index-cleanup-on-load to fix/no-index-cleanup-on-load-env-var February 15, 2024 19:22
@julio-lopez
Copy link
Author

Closing in favor of the upstream PR kopia#3651

@julio-lopez julio-lopez deleted the draft/index-maintenance branch February 16, 2024 22:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
2 participants