Skip to content

An initial implementation of kCompactionStopStyleSimilarSize for universal compaction#47

Merged
igorcanadi merged 3 commits into
facebook:masterfrom
mlin:kCompactionStopStyleSimilarSize
Mar 5, 2014
Merged

An initial implementation of kCompactionStopStyleSimilarSize for universal compaction#47
igorcanadi merged 3 commits into
facebook:masterfrom
mlin:kCompactionStopStyleSimilarSize

Conversation

@mlin

@mlin mlin commented Dec 26, 2013

Copy link
Copy Markdown
Contributor

rocksdb/universal_compaction.h describes an alternate strategy for picking files to merge in a universal compaction, kCompactionStopStyleSimilarSize, but there's no apparent implementation. The strategy (if I understood it correctly) is precisely what I needed for a specific application, so I implemented it. Probably this will need some further adjustments going forward, but it's doing the trick for me.

Mike Lin added 2 commits January 16, 2014 22:54
1) make summary less likely to be truncated
2) format human-readable file sizes in summary
3) log the motivation for each universal compaction
@mlin

mlin commented Jan 17, 2014

Copy link
Copy Markdown
Contributor Author

I rebased this in light of c699c84

@dhruba

dhruba commented Jan 17, 2014

Copy link
Copy Markdown
Contributor

Can somebody pl review this? Looks like an useful implementation to me.

Comment thread db/compaction.cc Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This means lots of memcpy and it's all done inside of the mutex. Can you refactor the code such that InputSummary directly takes char* output (parameter of Summary) and returns the size (so that you can keep writing) (maybe Summary can also take char **output and advance the pointer automatically)? You can do similar thing with FileSizeSummary.

@igorcanadi

Copy link
Copy Markdown
Contributor

I have small comments, but code mostly looks good. Would like somebody else to take a look at it, though.

@mlin

mlin commented Jan 17, 2014

Copy link
Copy Markdown
Contributor Author

Thanks for the comments so far, agree & will do next week.

- reduce string copying in Compaction::Summary
- simplify file number checking in UniversalCompactionStopStyleSimilarSize unit test
@igorcanadi

Copy link
Copy Markdown
Contributor

Hey @mlin , are you interested in finishing this or should we take over?

@mlin

mlin commented Feb 27, 2014

Copy link
Copy Markdown
Contributor Author

Sorry for delayed reply- 5e3aeb5 addressed the specific comments and I have no further immediate plans. All yours!

igorcanadi added a commit that referenced this pull request Mar 5, 2014
An initial implementation of kCompactionStopStyleSimilarSize for universal compaction
@igorcanadi igorcanadi merged commit 8ca30bd into facebook:master Mar 5, 2014
@igorcanadi

Copy link
Copy Markdown
Contributor

Tnx! :)

ajkr pushed a commit to ajkr/rocksdb that referenced this pull request Sep 12, 2019
…19.1-sst-insert-ordering

[19.1 backport] table: Always check key ordering when inserting to an SST
Nazgolze pushed a commit to Nazgolze/rocksdb-1 that referenced this pull request Sep 21, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

3 participants