The forceGarbageCollection was contributed by Twitter before. I remembered we wrapped that into a try-finally block. I just checked Twitter's branch. We did wrap that in a try-finally block. https://github.com/twitter/bookkeeper/blob/master/bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/GarbageCollectorThread.java#L563
I need to merge that back. - Sijie On Tue, Feb 7, 2017 at 10:22 PM, Charan Reddy G <reddychara...@gmail.com> wrote: > Hey Sijie, > > Thanks for the response, but didn't get which finally block you are > referring to. Are you saying that before executing 'continue' statement in > major compaction 'if' block, forceGarbageCollection should be set to > false, so that force Major/Minor compaction would be run only once when > enableForceGC is called? > > Thanks, > Charan > > On Feb 7, 2017 10:08 PM, "Sijie Guo" <si...@apache.org> wrote: > >> I think forceGarabageCollection should be set in a final block. Can't >> remember why it wasn't in current master branch. >> >> - Sijie >> >> On Tue, Feb 7, 2017 at 7:01 PM, Charan Reddy G <reddychara...@gmail.com> >> wrote: >> >>> Hi, >>> >>> I'm trying to understand the reason behind "continue;" statement in line >>> 352 of GarbageCollectorThread.java (https://github.com/apache/boo >>> kkeeper/blob/master/bookkeeper-server/src/main/java/org/apac >>> he/bookkeeper/bookie/GarbageCollectorThread.java). It is understandable >>> that if we have done majorcompaction then minor compaction is not required >>> and it can be skipped, but aren't we missing "forceGarbageCollection. >>> set(false);" in line 362? Or is it supposed to be like that? >>> >>> Basically I'm trying to findout when enableForceGC() is called, is it >>> supposed to trigger and do force GC/Compaction just once or untill it gets >>> disabled by calling disableForceGC()? >>> >>> Thanks, >>> Charan >>> >> >>