-
Notifications
You must be signed in to change notification settings - Fork 8
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
base: main
Are you sure you want to change the base?
Conversation
include/leveldb/c.h
Outdated
@@ -189,6 +189,8 @@ LEVELDB_EXPORT void leveldb_options_set_block_restart_interval( | |||
leveldb_options_t*, int); | |||
LEVELDB_EXPORT void leveldb_options_set_max_file_size(leveldb_options_t*, | |||
size_t); | |||
LEVELDB_EXPORT void leveldb_options_set_disable_seek_autocompaction(leveldb_options_t*, | |||
uint8_t); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
extreme nit: inconsistency between using spaces and tabs
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This has been addressed 👍
db/version_set.cc
Outdated
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) { |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
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.