Post

4 followers Follow
0
Avatar

ClassCastException while selecting from SYS.MEMORYANALYTICS

I am getting below exception while trying to run select * from SYS.MEMORYANALYTICS.

ERROR 38000: SQLSTATE=38000,SEVERITY=-1: (Server=liacs117.lss.emc.com[1528],Thread[DRDAConnThread_573,5,gemfirexd.daemons]) The exception 'java.lang.ClassCastException: com.gemstone.gemfire.internal.cache.wan.serial.SerialGatewaySenderQueue$SerialGatewaySenderQueueMetaRegion cannot be cast to com.gemstone.gemfire.internal.cache.PartitionedRegion' was thrown while evaluating an expression.
Caused by: SqlException: SQLSTATE=38000,SEVERITY=-1: (Server=liacs117.lss.emc.com[1528],Thread[DRDAConnThread_573,5,gemfirexd.daemons]) The exception 'java.lang.ClassCastException: com.gemstone.gemfire.internal.cache.wan.serial.SerialGatewaySenderQueue$SerialGatewaySenderQueueMetaRegion cannot be cast to com.gemstone.gemfire.internal.cache.PartitionedRegion' was thrown while evaluating an expression.
at com.pivotal.gemfirexd.internal.client.am.Statement.completeSqlca(Statement.java:1991)

arghya sadhu

Please sign in to leave a comment.

8 comments

0
Avatar

This is a bug in the ObjectSizer.iterateRegionQueue method. Its attempting to cast a SerialGatewaySenderQueueMetaRegion (which is a DistributedRegion) to a PartitionedRegion. The only work-around I can think of is to remove the GATEWAYSENDER or ASYNCEVENTLISTENER (whichever it is) before executing the SYS.MEMORYANALYTICS, then adding it back in afterwards.

To remove the GATEWAYSENDER or ASYNCEVENTLISTENER:

ALTER TABLE table SET ASYNCEVENTLISTENER ();
<or>
ALTER TABLE table SET GATEWAYSENDER ();

To add the GATEWAYSENDER or ASYNCEVENTLISTENER:

ALTER TABLE table SET ASYNCEVENTLISTENER(listener);
<or>
ALTER TABLE table SET GATEWAYSENDER (sender);

Here is the full stack.

info 2014/08/20 12:18:03.899 PDT GFXD: <Function Execution Processor1> tid=0x59, (SESSIONID = 3), (DATABASE = gemfirexd), (DRDAID = null), Failed Statement is: select * from SYS.MEMORYANALYTICS
ERROR 38000: The exception 'java.lang.ClassCastException: com.gemstone.gemfire.internal.cache.wan.serial.SerialGatewaySenderQueue$SerialGatewaySenderQueueMetaRegion cannot be cast to com.gemstone.gemfire.internal.cache.PartitionedRegion' was thrown while evaluating an expression.
at com.pivotal.gemfirexd.internal.iapi.error.StandardException.newException(StandardException.java:461)
at com.pivotal.gemfirexd.internal.iapi.error.StandardException.unexpectedUserException(StandardException.java:763)
at com.pivotal.gemfirexd.internal.impl.sql.execute.VTIResultSet.getNextRowCore(VTIResultSet.java:377)
at com.pivotal.gemfirexd.internal.impl.sql.execute.BasicNoPutResultSetImpl.getNextRow(BasicNoPutResultSetImpl.java:562)
at com.pivotal.gemfirexd.internal.impl.jdbc.EmbedResultSet.movePosition(EmbedResultSet.java:591)
at com.pivotal.gemfirexd.internal.impl.jdbc.EmbedResultSet.lightWeightNext(EmbedResultSet.java:471)
at com.pivotal.gemfirexd.internal.engine.distributed.ResultHolder.processRows(ResultHolder.java:1021)
at com.pivotal.gemfirexd.internal.engine.distributed.ResultHolder.prepareSend(ResultHolder.java:443)
at com.pivotal.gemfirexd.internal.engine.distributed.StatementQueryExecutor.executeStatement(StatementQueryExecutor.java:156)
at com.pivotal.gemfirexd.internal.engine.distributed.message.StatementExecutorMessage.execute(StatementExecutorMessage.java:216)
at com.pivotal.gemfirexd.internal.engine.distributed.message.GfxdFunctionMessage.processMessage(GfxdFunctionMessage.java:704)
at com.pivotal.gemfirexd.internal.engine.distributed.GfxdMessage.basicProcess(GfxdMessage.java:393)
at com.gemstone.gemfire.internal.cache.AbstractOperationMessage.process(AbstractOperationMessage.java:194)
at com.gemstone.gemfire.distributed.internal.DistributionMessage.scheduleAction(DistributionMessage.java:415)
at com.gemstone.gemfire.distributed.internal.DistributionMessage$1.run(DistributionMessage.java:483)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:895)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:918)
at com.gemstone.gemfire.distributed.internal.DistributionManager.runUntilShutdown(DistributionManager.java:728)
at com.gemstone.gemfire.distributed.internal.DistributionManager$9$1.run(DistributionManager.java:1178)
at java.lang.Thread.run(Thread.java:680)
============= begin nested exception, level (1) ===========
java.lang.ClassCastException: com.gemstone.gemfire.internal.cache.wan.serial.SerialGatewaySenderQueue$SerialGatewaySenderQueueMetaRegion cannot be cast to com.gemstone.gemfire.internal.cache.PartitionedRegion
at com.pivotal.gemfirexd.tools.sizer.ObjectSizer.iterateRegionQueue(ObjectSizer.java:603)
at com.pivotal.gemfirexd.tools.sizer.ObjectSizer.estimateQueueSizes(ObjectSizer.java:542)
at com.pivotal.gemfirexd.tools.sizer.ObjectSizer.size(ObjectSizer.java:448)
at com.pivotal.gemfirexd.internal.engine.diag.MemoryAnalyticsVTI.next(MemoryAnalyticsVTI.java:145)
at com.pivotal.gemfirexd.internal.engine.diag.MemoryAnalyticsVTI.nextRow(MemoryAnalyticsVTI.java:436)
at com.pivotal.gemfirexd.internal.impl.sql.execute.VTIResultSet.getNextRowCore(VTIResultSet.java:348)
... 17 more
============= end nested exception, level (1) ===========

Barry Oglesby 0 votes
0
Avatar

Hi Barry,
The work around you propose does not sound good.Is this bug being tracked and worked on?

arghya sadhu 0 votes
0
Avatar

Yes, there is a proposed fix that is being tested.I just want to confirm the version you're running.

Barry Oglesby 0 votes
0
Avatar

The fix for this bug didn't make it in time for GFXD 1.3, so it has been added to the 1.3 maintenance branch. GFXD 1.3.1 will be available in a few weeks.

Barry Oglesby 0 votes