[
https://issues.redhat.com/browse/ISPN-12538?page=com.atlassian.jira.plugi...
]
Dan Berindei resolved ISPN-12538.
---------------------------------
Resolution: Explained
The {{ClassCastException}} appears because the {{org.infinispan.LOCKS}} is not configured
with the same cache mode on all the cluster members:
* Regular members have {{clustered-locks num-owners > 0}}, so they define a
{{DIST_SYNC}} locks cache.
* The zero-capacity node has {{clustered-locks num-owners = -1}}, so it defines a
{{REPL_SYNC}} locks cache.
We should have a better error message when a node joins with a different cache mode, but
I'm not sure we need a new JIRA as we already have ISPN-4879.
Clustered Locks with zero-capacity throws ClassCastException
------------------------------------------------------------
Key: ISPN-12538
URL:
https://issues.redhat.com/browse/ISPN-12538
Project: Infinispan
Issue Type: Bug
Components: Clustered Locks
Affects Versions: 12.0.0.Dev07
Reporter: Ryan Emerson
Assignee: Dan Berindei
Priority: Major
Fix For: 12.1.0.Final
When creating a cluster with no explicit clustered-locks configuration, i.e. num_Owners
is not defined, a `ClassCastException` is thrown if a zero-capacity node joins the cluster
and attempts to use a lock:
{code:java}
10:10:36,564 ERROR (non-blocking-thread--p2-t2)
[org.infinispan.topology.LocalTopologyManagerImpl] ISPN000230: Failed to start rebalance
for cache org.infinispan.LOCKS java.util.concurrent.CompletionException:
java.lang.ClassCastException: class
org.infinispan.distribution.ch.impl.ReplicatedConsistentHash cannot be cast to class
org.infinispan.distribution.ch.impl.DefaultConsistentHash
(org.infinispan.distribution.ch.impl.ReplicatedConsistentHash and
org.infinispan.distribution.ch.impl.DefaultConsistentHash are in unnamed module of loader
java.net.URLClassLoader @6d03e736)
at
java.base/java.util.concurrent.CompletableFuture.encodeRelay(CompletableFuture.java:367)
at
java.base/java.util.concurrent.CompletableFuture.completeRelay(CompletableFuture.java:376)
at
java.base/java.util.concurrent.CompletableFuture$UniRelay.tryFire(CompletableFuture.java:1019)
at
java.base/java.util.concurrent.CompletableFuture.postComplete(CompletableFuture.java:506)
at
java.base/java.util.concurrent.CompletableFuture.completeExceptionally(CompletableFuture.java:2088)
at
org.infinispan.util.concurrent.ActionSequencer$SequenceEntry.accept(ActionSequencer.java:213)
at
org.infinispan.util.concurrent.ActionSequencer$SequenceEntry.accept(ActionSequencer.java:179)
at
java.base/java.util.concurrent.CompletableFuture.uniWhenComplete(CompletableFuture.java:859)
at
java.base/java.util.concurrent.CompletableFuture.uniWhenCompleteStage(CompletableFuture.java:883)
at
java.base/java.util.concurrent.CompletableFuture.whenComplete(CompletableFuture.java:2251)
at
java.base/java.util.concurrent.CompletableFuture.whenComplete(CompletableFuture.java:143)
at
org.infinispan.util.concurrent.ActionSequencer$SequenceEntry.run(ActionSequencer.java:227)
at
org.infinispan.util.concurrent.ActionSequencer$SequenceEntry.apply(ActionSequencer.java:219)
at
org.infinispan.util.concurrent.ActionSequencer$SequenceEntry.apply(ActionSequencer.java:179)
at
java.base/java.util.concurrent.CompletableFuture.uniHandle(CompletableFuture.java:930)
at
java.base/java.util.concurrent.CompletableFuture$UniHandle.tryFire(CompletableFuture.java:907)
at
java.base/java.util.concurrent.CompletableFuture$Completion.run(CompletableFuture.java:478)
at
java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
at
java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
at java.base/java.lang.Thread.run(Thread.java:834)
Caused by: java.lang.ClassCastException: class
org.infinispan.distribution.ch.impl.ReplicatedConsistentHash cannot be cast to class
org.infinispan.distribution.ch.impl.DefaultConsistentHash
(org.infinispan.distribution.ch.impl.ReplicatedConsistentHash and
org.infinispan.distribution.ch.impl.DefaultConsistentHash are in unnamed module of loader
java.net.URLClassLoader @6d03e736)
at
org.infinispan.distribution.ch.impl.SyncConsistentHashFactory.union(SyncConsistentHashFactory.java:58)
at
org.infinispan.topology.LocalTopologyManagerImpl.doHandleRebalance(LocalTopologyManagerImpl.java:562)
at
org.infinispan.topology.LocalTopologyManagerImpl.lambda$handleRebalance$16(LocalTopologyManagerImpl.java:531)
at
org.infinispan.topology.LocalTopologyManagerImpl.lambda$orderOnCache$24(LocalTopologyManagerImpl.java:736)
at
org.infinispan.util.concurrent.ActionSequencer.safeNonBlockingCall(ActionSequencer.java:57)
at
org.infinispan.util.concurrent.ActionSequencer.access$400(ActionSequencer.java:32)
at
org.infinispan.util.concurrent.ActionSequencer$SequenceEntry.run(ActionSequencer.java:226)
... 8 more
{code}
Previously zero-capacity node was not supported with replicated-caches, however this is
no longer the case so it should be possible for clustered-locks to work with a replicated
cache without defining num_owners.
--
This message was sent by Atlassian Jira
(v8.13.1#813001)