nicoloboschi commented on code in PR #3205:
URL: https://github.com/apache/bookkeeper/pull/3205#discussion_r850367004
##########
bookkeeper-server/src/main/java/org/apache/bookkeeper/server/http/service/TriggerGCService.java:
##########
@@ -61,7 +62,16 @@ public HttpServiceResponse handle(HttpServiceRequest
request) throws Exception {
HttpServiceResponse response = new HttpServiceResponse();
if (HttpServer.Method.PUT == request.getMethod()) {
- bookieServer.getBookie().getLedgerStorage().forceGC();
+ String requestBody = request.getBody();
+ if (null == requestBody) {
+ bookieServer.getBookie().getLedgerStorage().forceGC();
+ } else {
+ @SuppressWarnings("unchecked")
+ HashMap<String, Object> configMap =
JsonUtil.fromJson(requestBody, HashMap.class);
Review Comment:
in general it is better to use interface here, like `java.util.Map`. just a
nit
##########
bookkeeper-server/src/test/java/org/apache/bookkeeper/bookie/CompactionTest.java:
##########
@@ -332,6 +332,95 @@ public void checkpointComplete(Checkpoint checkPoint,
boolean compact)
});
}
+ @Test
+ public void testForceGarbageCollectionWhenDiskIsFull() throws Exception {
+ testForceGarbageCollectionWhenDiskIsFull(true);
+ testForceGarbageCollectionWhenDiskIsFull(false);
+ }
+
+ public void testForceGarbageCollectionWhenDiskIsFull(boolean
isForceCompactionAllowWhenDisableCompaction)
+ throws Exception {
+
+ restartBookies(conf -> {
+ if (isForceCompactionAllowWhenDisableCompaction) {
+ conf.setMinorCompactionInterval(0);
+ conf.setMajorCompactionInterval(0);
+ conf.setForceAllowCompaction(true);
+ conf.setMajorCompactionThreshold(0.5f);
+ conf.setMinorCompactionThreshold(0.2f);
+ } else {
+ conf.setMinorCompactionInterval(120000);
Review Comment:
can we use lower interval? this test will take several minutes to complete
--
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]