-
Notifications
You must be signed in to change notification settings - Fork 964
Fix SST files not being cleaned up in the locations folder #4555
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
Conversation
|
I believe this issue is related to optimization #3653. When using To resolve this issue: |
bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/GarbageCollectorThread.java
Outdated
Show resolved
Hide resolved
@danpi Great job! I think it should be a bug in RocksDB. We can use option 2. Please check the failed CI, thanks. |
bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/GarbageCollectorThread.java
Outdated
Show resolved
Hide resolved
|
@hangc0276 Addressed the feedback above. PTAL, thanks. |
| long majorCompactionMaxTimeMillis; | ||
| long lastMajorCompactionTime; | ||
|
|
||
| boolean enableEntryLocationCompaction = false; |
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.
Remove this one and use entryLocationCompactionInterval > 0 instead?
| minorCompacting.set(false); | ||
| } | ||
| } | ||
| if (enableEntryLocationCompaction && (curTime - lastEntryLocationCompactionTime |
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.
We'd better introduce a random factor for it. If we roll restart the BookKeeper cluster, and all the bookies start time are the same, which will make all the bookies triggered RocksDB compaction at the same time and impact the read latency.
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 random factor can be any time in [0, entryLocationCompactionInterval]
@danpi Thanks for your contribution. I left more comments; please take a look. Thanks. |
…ion simultaneously
@hangc0276 Add |
|
@danpi Would you please fix the check style issue? |
|
@danpi Could you help to fix the checkstyle. |
* fix entry location compaction * replace entryLocationCompactionEnable with entryLocationCompactionInterval * Add randomCompactionDelay to avoid all the bookies triggering compaction simultaneously * Fix the style issue * Fix the style issue * Fix test --------- Co-authored-by: houbonan <[email protected]> Co-authored-by: zymap <[email protected]> (cherry picked from commit ede1ba9)
* fix entry location compaction * replace entryLocationCompactionEnable with entryLocationCompactionInterval * Add randomCompactionDelay to avoid all the bookies triggering compaction simultaneously * Fix the style issue * Fix the style issue * Fix test --------- Co-authored-by: houbonan <[email protected]> Co-authored-by: zymap <[email protected]> (cherry picked from commit ede1ba9)
* fix entry location compaction * replace entryLocationCompactionEnable with entryLocationCompactionInterval * Add randomCompactionDelay to avoid all the bookies triggering compaction simultaneously * Fix the style issue * Fix the style issue * Fix test --------- Co-authored-by: houbonan <[email protected]> Co-authored-by: zymap <[email protected]> (cherry picked from commit ede1ba9) (cherry picked from commit 138849a)
* fix entry location compaction * replace entryLocationCompactionEnable with entryLocationCompactionInterval * Add randomCompactionDelay to avoid all the bookies triggering compaction simultaneously * Fix the style issue * Fix the style issue * Fix test --------- Co-authored-by: houbonan <[email protected]> Co-authored-by: zymap <[email protected]> (cherry picked from commit ede1ba9) (cherry picked from commit 138849a)
Descriptions of the changes in this PR:
Fix #4554
Motivation
Resolve issue with SST files remaining uncleared in the locations folder.
Changes
GarbageCollectorThreadto trigger entryLocationCompact() when a major compaction occurs.entryLocationCompactionconfiguration option to control the above behavior, disabled by default.