geode-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Eric Shu (JIRA)" <j...@apache.org>
Subject [jira] [Resolved] (GEODE-2799) ClassCastException: java.lang.Long cannot be cast to org.apache.geode.internal.cache.AbstractRegionEntry could occur in race condition
Date Fri, 21 Apr 2017 21:05:04 GMT

     [ https://issues.apache.org/jira/browse/GEODE-2799?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Eric Shu resolved GEODE-2799.
-----------------------------
       Resolution: Fixed
    Fix Version/s: 1.2.0

> ClassCastException: java.lang.Long cannot be cast to org.apache.geode.internal.cache.AbstractRegionEntry
could occur in race condition
> --------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: GEODE-2799
>                 URL: https://issues.apache.org/jira/browse/GEODE-2799
>             Project: Geode
>          Issue Type: Bug
>          Components: transactions
>            Reporter: Eric Shu
>            Assignee: Eric Shu
>             Fix For: 1.2.0
>
>
> {noformat}
> java.lang.ClassCastException: java.lang.Long cannot be cast to org.apache.geode.internal.cache.AbstractRegionEntry
> at org.apache.geode.internal.cache.LocalRegionDataView.getKeyForIterator(LocalRegionDataView.java:203)
> at org.apache.geode.internal.cache.TXStateProxyImpl.getKeyForIterator(TXStateProxyImpl.java:766)
> at org.apache.geode.internal.cache.EntriesSet$EntriesIterator.moveNext(EntriesSet.java:159)
> at org.apache.geode.internal.cache.EntriesSet$EntriesIterator.(EntriesSet.java:118)
> at org.apache.geode.internal.cache.EntriesSet.iterator(EntriesSet.java:83)
> at java.util.AbstractCollection.addAll(AbstractCollection.java:343)
> at java.util.TreeSet.addAll(TreeSet.java:312)
> at java.util.TreeSet.(TreeSet.java:160)
> at org.apache.geode.internal.cache.BucketRegionQueue.initializeEventSeqNumQueue(BucketRegionQueue.java:145)
> at org.apache.geode.internal.cache.BucketRegionQueue.cleanUpDestroyedTokensAndMarkGIIComplete(BucketRegionQueue.java:108)
> at org.apache.geode.internal.cache.DistributedRegion.getInitialImageAndRecovery(DistributedRegion.java:1288)
> at org.apache.geode.internal.cache.DistributedRegion.initialize(DistributedRegion.java:1080)
> at org.apache.geode.internal.cache.BucketRegion.initialize(BucketRegion.java:251)
> at org.apache.geode.internal.cache.LocalRegion.createSubregion(LocalRegion.java:960)
> at org.apache.geode.internal.cache.PartitionedRegionDataStore.createBucketRegion(PartitionedRegionDataStore.java:736)
> at org.apache.geode.internal.cache.PartitionedRegionDataStore.grabFreeBucket(PartitionedRegionDataStore.java:424)
> at org.apache.geode.internal.cache.PartitionedRegionDataStore.grabFreeBucketRecursively(PartitionedRegionDataStore.java:282)
> at org.apache.geode.internal.cache.PartitionedRegionDataStore.grabBucket(PartitionedRegionDataStore.java:2860)
> at org.apache.geode.internal.cache.PartitionedRegionDataStore.handleManageBucketRequest(PartitionedRegionDataStore.java:1001)
> at org.apache.geode.internal.cache.PRHARedundancyProvider.createBucketOnMember(PRHARedundancyProvider.java:1214)
> at org.apache.geode.internal.cache.PRHARedundancyProvider.createBucketInstance(PRHARedundancyProvider.java:390)
> at org.apache.geode.internal.cache.PRHARedundancyProvider.createBucketAtomically(PRHARedundancyProvider.java:578)
> at org.apache.geode.internal.cache.PartitionedRegion.createBucket(PartitionedRegion.java:3257)
> at org.apache.geode.internal.cache.partitioned.RegionAdvisor$BucketSet$BucketSetIterator.next(RegionAdvisor.java:1422)
> at org.apache.geode.internal.cache.PartitionedRegion$KeysSet$KeysSetIterator.getNextBucketIter(PartitionedRegion.java:6247)
> at org.apache.geode.internal.cache.PartitionedRegion$KeysSet$KeysSetIterator.hasNext(PartitionedRegion.java:6220)
> at org.apache.geode.internal.cache.PartitionedRegion$KeysSet.toArray(PartitionedRegion.java:6322)
> at org.apache.geode.internal.cache.PartitionedRegion$KeysSet.toArray(PartitionedRegion.java:6316)
> at java.util.Collections$UnmodifiableCollection.toArray(Collections.java:1033)
> at java.util.ArrayList.addAll(ArrayList.java:577)
> {noformat}
> KeySet createIterator in transaction always creates keyset(). When a transaction accesses
the items, it suspends the transaction and assumes the items provided by iterator are AbrstractRegionEntry.
>     private void createIterator(final LocalRegion rgn) {
>       // TX iterates over KEYS.
>       // NonTX iterates over RegionEntry instances
>       this.currRgn = rgn;
>       this.currItr = view.getRegionKeysForIteration(rgn).iterator();
>       this.additionalKeysFromView = view.getAdditionalKeysForIterator(rgn);
>     }



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

Mime
View raw message