-
Notifications
You must be signed in to change notification settings - Fork 914
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
Fix SST files not being cleaned up in the locations folder #4555
base: master
Are you sure you want to change the base?
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. |
@@ -87,6 +87,10 @@ public class GarbageCollectorThread implements Runnable { | |||
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?
@@ -489,6 +505,17 @@ public void runWithFlags(boolean force, boolean suspendMajor, boolean suspendMin | |||
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 |
Descriptions of the changes in this PR:
Fix #4554
Motivation
Resolve issue with SST files remaining uncleared in the locations folder.
Changes
GarbageCollectorThread
to trigger entryLocationCompact() when a major compaction occurs.entryLocationCompaction
configuration option to control the above behavior, disabled by default.