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: remove double checks of memtable size #4117

Merged
merged 3 commits into from
Jun 7, 2024

Conversation

byte-sourcerer
Copy link
Contributor

I hereby agree to the terms of the GreptimeDB CLA.

What's changed and what's your intention?

In the freeze_mutable function, the method memtables.mutable.is_empty() is checked twice - once in VersionControl::freeze_mutable and again in MemtableVersion::freeze_mutable. These check could be combined so the unwrap can be eliminated.

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 7, 2024
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.

Good catch!

Copy link

codecov bot commented Jun 7, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 85.10%. Comparing base (e142ca4) to head (69a1da0).

Current head 69a1da0 differs from pull request most recent head e77c8b9

Please upload reports for the commit e77c8b9 to get more accurate results.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4117      +/-   ##
==========================================
- Coverage   85.40%   85.10%   -0.30%     
==========================================
  Files         994      994              
  Lines      174093   173988     -105     
==========================================
- Hits       148682   148073     -609     
- Misses      25411    25915     +504     

Copy link
Contributor

@v0y4g3r v0y4g3r left a comment

Choose a reason for hiding this comment

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

LGTM

@killme2008 killme2008 added this pull request to the merge queue Jun 7, 2024
@killme2008
Copy link
Contributor

Thank you.

@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Jun 7, 2024
@killme2008 killme2008 enabled auto-merge June 7, 2024 23:20
@killme2008 killme2008 added this pull request to the merge queue Jun 7, 2024
Merged via the queue into GreptimeTeam:main with commit d8b51cf Jun 7, 2024
41 checks passed
@byte-sourcerer byte-sourcerer deleted the rm-option branch June 8, 2024 01:32
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.

3 participants