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

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

yabmek-msft
Copy link
Collaborator

@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
@@ -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);
Copy link
Collaborator

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

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This has been addressed 👍

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.

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.

4 participants