You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@geode.apache.org by "Srikanth Manvi (JIRA)" <ji...@apache.org> on 2017/05/03 15:07:04 UTC

[jira] [Commented] (GEODE-2676) RegionMBean statistics wrong on partitioned regions

    [ https://issues.apache.org/jira/browse/GEODE-2676?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15995031#comment-15995031 ] 

Srikanth Manvi commented on GEODE-2676:
---------------------------------------

On the geode mailing list I was told the below might be relevant for this story.
I see a NPE when I run gfsh show metrics command by passing a member  Ex: {code}gfsh>show metrics --region=/Customer_Partition --member=geode-server2{code}. There is no problem when we dont pass `--member=geode-server2`

{noformat}
gfsh>show metrics --region=/Customer_Partition --member=geode-server2
Could not process command due to GemFire error. #SBjava.lang.NullPointerException
    at com.sun.proxy.$Proxy81.getMissCount(Unknown Source)
    at org.apache.geode.management.internal.cli.commands.MiscellaneousCommands.getRegionMetricsFromMember(MiscellaneousCommands.java:1970)
    at org.apache.geode.management.internal.cli.commands.MiscellaneousCommands.showMetrics(MiscellaneousCommands.java:1200)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:497)
    at org.springframework.util.ReflectionUtils.invokeMethod(ReflectionUtils.java:216)
    at org.apache.geode.management.internal.cli.remote.RemoteExecutionStrategy.execute(RemoteExecutionStrategy.java:91)
    at org.apache.geode.management.internal.cli.remote.CommandProcessor.executeCommand(CommandProcessor.java:117)
    at org.apache.geode.management.internal.cli.remote.CommandStatementImpl.process(CommandStatementImpl.java:71)
    at org.apache.geode.management.internal.cli.remote.MemberCommandService.processCommand(MemberCommandService.java:52)
    at org.apache.geode.management.internal.beans.MemberMBeanBridge.processCommand(MemberMBeanBridge.java:1639)
    at org.apache.geode.management.internal.beans.MemberMBean.processCommand(MemberMBean.java:404)
    at org.apache.geode.management.internal.beans.MemberMBean.processCommand(MemberMBean.java:397)
    at sun.reflect.GeneratedMethodAccessor298.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:497)
    at sun.reflect.misc.Trampoline.invoke(MethodUtil.java:71)
    at sun.reflect.GeneratedMethodAccessor10.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:497)
    at sun.reflect.misc.MethodUtil.invoke(MethodUtil.java:275)
    at com.sun.jmx.mbeanserver.ConvertingMethod.invokeWithOpenReturn(ConvertingMethod.java:193)
    at com.sun.jmx.mbeanserver.ConvertingMethod.invokeWithOpenReturn(ConvertingMethod.java:175)
    at com.sun.jmx.mbeanserver.MXBeanIntrospector.invokeM2(MXBeanIntrospector.java:117)
    at com.sun.jmx.mbeanserver.MXBeanIntrospector.invokeM2(MXBeanIntrospector.java:54)
    at com.sun.jmx.mbeanserver.MBeanIntrospector.invokeM(MBeanIntrospector.java:237)
    at com.sun.jmx.mbeanserver.PerInterface.invoke(PerInterface.java:138)
    at com.sun.jmx.mbeanserver.MBeanSupport.invoke(MBeanSupport.java:252)
    at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerInterceptor.java:819)
    at com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer.java:801)
    at javax.management.remote.rmi.RMIConnectionImpl.doOperation(RMIConnectionImpl.java:1468)
    at javax.management.remote.rmi.RMIConnectionImpl.access$300(RMIConnectionImpl.java:76)
    at javax.management.remote.rmi.RMIConnectionImpl$PrivilegedOperation.run(RMIConnectionImpl.java:1309)
    at javax.management.remote.rmi.RMIConnectionImpl.doPrivilegedOperation(RMIConnectionImpl.java:1401)
    at javax.management.remote.rmi.RMIConnectionImpl.invoke(RMIConnectionImpl.java:829)
    at sun.reflect.GeneratedMethodAccessor76.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:497)
    at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:323)
    at sun.rmi.transport.Transport$1.run(Transport.java:200)
    at sun.rmi.transport.Transport$1.run(Transport.java:197)
    at java.security.AccessController.doPrivileged(Native Method)
    at sun.rmi.transport.Transport.serviceCall(Transport.java:196)
    at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:568)
    at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(TCPTransport.java:826)
    at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.lambda$run$256(TCPTransport.java:683)
    at java.security.AccessController.doPrivileged(Native Method)
    at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:682)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
    at java.lang.Thread.run(Thread.java:745)
{noformat}


{noformat}
gfsh>version --full
Build-Date: 2017-03-27 21:52:42 -0700
Build-Id: abaker 0
Build-Java-Version: 1.8.0_121
Build-Platform: Mac OS X 10.12.3 x86_64
Product-Name: Apache Geode
Product-Version: 1.1.1
Source-Date: 2017-03-27 21:36:40 -0700
Source-Repository: release/1.1.1
Source-Revision: e2081044ea0afca1cb38d62c7f34e7363b45ad97
Native version: native code unavailable
Running on: /10.8.4.

{noformat}


> RegionMBean statistics wrong on partitioned regions
> ---------------------------------------------------
>
>                 Key: GEODE-2676
>                 URL: https://issues.apache.org/jira/browse/GEODE-2676
>             Project: Geode
>          Issue Type: Bug
>          Components: management
>            Reporter: Fred Krone
>            Priority: Minor
>              Labels: jmx
>
> RegionMBean attributes hitCount, hitRatio, missCount, lastAccessedTime, and lastModifiedTime will always be 0 for an mbean that represents an partitioned region.
> The gettors for these methods may call getStatistics() which on a PR always throws UnsupportedOperationException. So this exception might even get exposed to customers.
> The initialization of RegionMBeanBridge calls getStatisticsEnabled() which returns true on a PartitionedRegion. This does have meaning on a PR but it does not mean that getStatistics() is a supported operation. On a PR setting statistics-enabled causes each region-entry to also keep track of its last access time.
> It is true that if getStatisticsEnabled() is false then you should not call getStatistics. But the opposite is not true. Since we currently have regions that do not support getStatistics(), the code in RegionMBeanBridge should catch UnsupportedOperationException and handle it. I would suggest that the constructor be changed that initializes the "isStatisticsEnabled" field. Instead of only calling getStatisticsEnabled() it should also call getStatistics(). Something like this:
> {noformat}
>     {
>       boolean useGetStatistics = regAttrs.getStatisticsEnabled();
>       if (useGetStatistics) {
>         try {
>           region.getStatistics();
>         } catch (UnsupportedOperationException ex) {
>           useGetStatistics = false;
>         }
>       }
>       this.isStatisticsEnabled = useGetStatistics;
>     }
> {noformat}
> That way in a future release if PRs are changed to support getStatistics this code will start calling it without having a direct dependency on the implementation of PartitionedRegion.
> https://issues.apache.org/jira/browse/GEODE-2685 is a request to support getStatistics on PRs.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)