Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
1.12.0
Description
Executing a query like:
SELECT pnl.TM_ID, pnl.PTD_ACCRETION_INV_AMT, pnl.FIRM_ACCT_ID, pnl.INSM_ID, adj.PL_POSN_ID , adj.DLY_ACCRETION_INV_AMT FROM /PnLPosition4 pnl , /AdjustmentPosition4 adj where adj.PL_POSN_ID = pnl.PL_POSN_ID
Using a function that does:
QueryService queryService = CacheFactory.getAnyInstance().getQueryService(); Query query = queryService.newQuery(queryStr); SelectResults results = (SelectResults) query.execute(rfc); context.getResultSender().lastResult(results);
Causes one of two exceptions when the CumulativeNonDistinctResults is deserialized.
Either an IllegalArgumentException on the client like:
Caused by: java.lang.IllegalArgumentException: unexpected typeCode: 46 at org.apache.geode.internal.serialization.StaticSerialization.decodePrimitiveClass(StaticSerialization.java:502) at org.apache.geode.DataSerializer.readObjectArray(DataSerializer.java:1744) at org.apache.geode.cache.query.internal.CumulativeNonDistinctResults.fromData(CumulativeNonDistinctResults.java:293) at org.apache.geode.internal.serialization.internal.DSFIDSerializerImpl.invokeFromData(DSFIDSerializerImpl.java:332) at org.apache.geode.internal.serialization.internal.DSFIDSerializerImpl.create(DSFIDSerializerImpl.java:383)
Or an OutOfMemoryError on the server like:
java.lang.OutOfMemoryError: Java heap space at java.util.ArrayList.<init>(ArrayList.java:152) at org.apache.geode.cache.query.internal.CumulativeNonDistinctResults.fromData(CumulativeNonDistinctResults.java:289) at org.apache.geode.internal.serialization.internal.DSFIDSerializerImpl.invokeFromData(DSFIDSerializerImpl.java:332) at org.apache.geode.internal.serialization.internal.DSFIDSerializerImpl.create(DSFIDSerializerImpl.java:383) at org.apache.geode.internal.DSFIDFactory.create(DSFIDFactory.java:1018) at org.apache.geode.internal.InternalDataSerializer.basicReadObject(InternalDataSerializer.java:2508) at org.apache.geode.DataSerializer.readObject(DataSerializer.java:2864)
CumulativeNonDistinctResults.toData does:
HeapDataOutputStream hdos = new HeapDataOutputStream(1024, null); LongUpdater lu = hdos.reserveLong(); ... DataSerializer.writeObjectArray(fields, out); ... lu.update(numElements);
NWayMergeResults.toData is broken in the same way
The fix is to write the fields to hdos instead of out like:
DataSerializer.writeObjectArray(fields, hdos);
A work-around in the function is to convert the CumulativeNonDistinctResults to a List like:
context.getResultSender().lastResult(results.asList());
Attachments
Issue Links
- links to