-
Notifications
You must be signed in to change notification settings - Fork 45
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
feat: avoid sst compacat twice #154
base: main
Are you sure you want to change the base?
Conversation
Self::next_level_scopes(version, &mut min, &mut max, level, &meet_scopes_l)?; | ||
|
||
meet_scopes_ll.retain(|scope| compact_status.insert(scope.gen)); |
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.
Is this retain meet_scopes_l
? Because there will be no new sstable in meet_scopes_ll
because compaction will increase step by step at level.
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.
It should be meet_scopes_ll
. Because we only care sstables that may be compacted in next compaction loop
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.
The meet_scopes_ll
of this compaction is the meet_scopes_l
of the next compaction, right?
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.
Yes, meet_scopes_l
also need filtering, but it needn't insert to compact_status
. So the code may be like this:
meet_scopes_l.retain(|scope| !compact_status.contains(&scope.gen));
meet_scopes_ll.iter().for_each(|scope| {
compact_status.insert(scope.gen);
});
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.
I'm not sure if compact_status
requires both meet_scopes_ll
to be inserted, new sstables are ignored here, and is it better to just insert new sstables?
It looks like the unit test is missing to verify that it is working properly |
#151
LevelStream::new
declaration to accept needed data onlythis_level_scopes
andnext_level_scopes