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: make region manifest checkpoint ran in background #4133

Merged
merged 6 commits into from
Jun 17, 2024

Conversation

MichaelScofield
Copy link
Collaborator

I hereby agree to the terms of the GreptimeDB CLA.

Refer to a related PR or issue link (optional)

What's changed and what's your intention?

Region manifest checkpoint currently requires many object store reads and writes. The checkpoint is performed synchronously in the region manifest update. When the object store is slow, it could easily cause the region manifest update method executes too long. This PR makes the checkpoint ran in the background (performed asynchronously) to solve the problem.

This PR also makes some changes to how the checkpoint is done. Originally the current checkpoint is the last checkpoint merged with all the incremental files. This process has to scan the object store. However, since the checkpoint is actually a snapshot of the current region manifest, which is already present in the memory, stick to the old ways seems unnecessary. So this PR directly use the region manifest snapshot to make current checkpoint, and delete the obsolete incremental files.

Checklist

  • I have written the necessary rustdoc comments.
  • I have added the necessary unit tests and integration tests.
  • This PR requires documentation updates.

@github-actions github-actions bot added the docs-not-required This change does not impact docs. label Jun 12, 2024
Copy link

codecov bot commented Jun 12, 2024

Codecov Report

Attention: Patch coverage is 93.42105% with 10 lines in your changes missing coverage. Please review.

Project coverage is 84.67%. Comparing base (e982d2e) to head (db7ca71).
Report is 21 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4133      +/-   ##
==========================================
- Coverage   85.39%   84.67%   -0.72%     
==========================================
  Files         994     1019      +25     
  Lines      173994   178741    +4747     
==========================================
+ Hits       148580   151351    +2771     
- Misses      25414    27390    +1976     

src/mito2/src/manifest/checkpointer.rs Outdated Show resolved Hide resolved
src/mito2/src/manifest/checkpointer.rs Outdated Show resolved Hide resolved
src/mito2/src/manifest/checkpointer.rs Outdated Show resolved Hide resolved
MichaelScofield and others added 2 commits June 14, 2024 17:35
Co-authored-by: Yingwen <realevenyag@gmail.com>
@MichaelScofield
Copy link
Collaborator Author

@evenyag @WenyXu @killme2008 PTAL

src/mito2/src/manifest/checkpointer.rs Outdated Show resolved Hide resolved
src/mito2/src/manifest/checkpointer.rs Outdated Show resolved Hide resolved
Copy link
Contributor

@killme2008 killme2008 left a comment

Choose a reason for hiding this comment

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

LGTM. It will help a lot when writing.

@MichaelScofield
Copy link
Collaborator Author

@evenyag PTAL

@evenyag evenyag enabled auto-merge June 17, 2024 03:17
@evenyag evenyag added this pull request to the merge queue Jun 17, 2024
Merged via the queue into GreptimeTeam:main with commit f4a5a44 Jun 17, 2024
49 checks passed
@MichaelScofield MichaelScofield deleted the chore/ent-sync branch June 17, 2024 06:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs-not-required This change does not impact docs.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants