You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@geode.apache.org by "gesterzhou (GitHub)" <gi...@apache.org> on 2020/02/05 22:17:46 UTC

[GitHub] [geode] gesterzhou commented on issue #4638: GEODE-7683: introduce BR.cmnClearRegion

> I'm not 100% sure I understand what this is implementing. Clearing a BucketRegion still fails the same way it has in the past.
> 
> I wrote a function that attempts to clear a PartitionedRegion by clearing all of its primary BucketRegions. To do that, it tried these API:
> 
> ```
> br.basicClear(regionEvent);
> br.basicClear(regionEvent, true);
> br.cmnClearRegion(regionEvent, true, true);
> ```
> 
> No matter which of those it called, this exception occurs:
> 
> ```
> Caused by: org.apache.geode.InternalGemFireError: Trying to clear a bucket region that was not destroyed or in initialization.
> 	at org.apache.geode.internal.cache.BucketRegion.updateSizeOnClearRegion(BucketRegion.java:2128)
> 	at org.apache.geode.internal.cache.AbstractRegionMap.clear(AbstractRegionMap.java:460)
> 	at org.apache.geode.internal.cache.BucketRegion.clearEntries(BucketRegion.java:2479)
> 	at org.apache.geode.internal.cache.LocalRegion.clearRegionLocally(LocalRegion.java:8544)
> 	at org.apache.geode.internal.cache.BucketRegion.cmnClearRegion(BucketRegion.java:578)
> 	at org.apache.geode.internal.cache.BasicClearBucketRegionFunction.basicClear(BasicClearBucketRegionFunction.java:32)
> 	at org.apache.geode.internal.cache.BasicClearBucketRegionFunction.execute(BasicClearBucketRegionFunction.java:21)
> 	at org.apache.geode.internal.cache.execute.AbstractExecution.executeFunctionLocally(AbstractExecution.java:328)
> 	at org.apache.geode.internal.cache.execute.AbstractExecution.lambda$executeFunctionOnLocalPRNode$0(AbstractExecution.java:273)
> 	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
> 	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
> 	at org.apache.geode.distributed.internal.ClusterOperationExecutors.runUntilShutdown(ClusterOperationExecutors.java:449)
> 	at org.apache.geode.distributed.internal.ClusterOperationExecutors.doFunctionExecutionThread(ClusterOperationExecutors.java:379)
> 	at org.apache.geode.logging.internal.executors.LoggingThreadFactory.lambda$newThread$0(LoggingThreadFactory.java:119)
> 	at java.lang.Thread.run(Thread.java:745)
> ```
> 
> AFAICT, a BucketRegion still can't be cleared.
> 
> When I hack-implemented this feature, I changed BucketRegion.updateSizeOnClearRegion to do this instead of throwing the InternalGemFireError. I'm not sure if this is valid, though.
> 
> ```
> oldMemValue = this.bytesInMemory.getAndSet(0);
> ```

This looks like a loose-end I did not found earlier. I will do that fix. And I will add this dunit test case in PR.clear. 

[ Full content available at: https://github.com/apache/geode/pull/4638 ]
This message was relayed via gitbox.apache.org for notifications@geode.apache.org