hangc0276 commented on code in PR #4555:
URL: https://github.com/apache/bookkeeper/pull/4555#discussion_r1983841060


##########
bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/GarbageCollectorThread.java:
##########
@@ -87,6 +87,10 @@ public class GarbageCollectorThread implements Runnable {
     long majorCompactionMaxTimeMillis;
     long lastMajorCompactionTime;
 
+    boolean enableEntryLocationCompaction = false;

Review Comment:
   Remove this one and use `entryLocationCompactionInterval > 0` instead?



##########
bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/GarbageCollectorThread.java:
##########
@@ -489,6 +505,17 @@ public void runWithFlags(boolean force, boolean 
suspendMajor, boolean suspendMin
                     minorCompacting.set(false);
                 }
             }
+            if (enableEntryLocationCompaction && (curTime - 
lastEntryLocationCompactionTime

Review Comment:
   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.



##########
bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/GarbageCollectorThread.java:
##########
@@ -489,6 +505,17 @@ public void runWithFlags(boolean force, boolean 
suspendMajor, boolean suspendMin
                     minorCompacting.set(false);
                 }
             }
+            if (enableEntryLocationCompaction && (curTime - 
lastEntryLocationCompactionTime

Review Comment:
   The random factor can be any time in [0, entryLocationCompactionInterval]



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to