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

Task AB#1310794: [LevelDB] Add option to disable seek compaction #4

Merged
merged 4 commits into from
Dec 20, 2024

Conversation

yabmek-msft
Copy link
Collaborator

https://dev-mc.visualstudio.com/Minecraft/_workitems/edit/1310794

Moved over the option to disable auto-compaction based on number of seeks. This is based on the two commits in leveldb-mcpe:

Second commit is a clean-up to get unit tests to pass.

@yabmek-msft yabmek-msft changed the title Task AB#1310794: [LevelDB] Add option to disable seek compaction #1216 Task AB#1310794: [LevelDB] Add option to disable seek compaction Dec 5, 2024
include/leveldb/c.h Outdated Show resolved Hide resolved
Comment on lines 405 to 406
f->allowed_seeks--;
if (f->allowed_seeks <= 0 && file_to_compact_ == nullptr) {
file_to_compact_ = f;
file_to_compact_level_ = stats.seek_file_level;
return true;
if (!vset_->options_->disable_seek_autocompaction) {

Choose a reason for hiding this comment

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

Just wondering if this line shouldn't be inside the if as well, in the Apply function we will not set the allowed seeks anymore so doesn't seem like we should be decrementing them as well.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

That's a good point, thanks for catching this! I agree with your assessment and will move the decrementing of allowed_seeks inside the if block.

Copy link
Collaborator

@rohunMS rohunMS left a comment

Choose a reason for hiding this comment

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

Approved for DoD pending completion of Author's checklist

@yabmek-msft yabmek-msft merged commit 3fb7203 into main Dec 20, 2024
16 checks passed
yabmek-msft added a commit that referenced this pull request Dec 20, 2024
)

* adding option to disable seek compaction

* Fixing failed test: convention is to have bools as uint8_t

* addressing feedback: inconsistency between spaces and tabs

* addressing feedback: moving allowed_seeks decrement

---------

Co-authored-by: Mike Biddlecombe <mike.biddlecombe@blackbirdinteractive.com>
@yabmek-msft yabmek-msft deleted the ymekonnen/option_disable_seek_compaction branch December 20, 2024 10:00
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.

5 participants