]
Galder Zamarreño updated ISPN-5477:
-----------------------------------
Fix Version/s: 8.0.0.Alpha2
8.0.0.Final
Compatibility with L1 can lead to wrong return type
---------------------------------------------------
Key: ISPN-5477
URL:
https://issues.jboss.org/browse/ISPN-5477
Project: Infinispan
Issue Type: Bug
Components: Remote Protocols
Affects Versions: 7.2.1.Final
Reporter: Galder Zamarreño
Assignee: Galder Zamarreño
Fix For: 7.2.2.Final, 8.0.0.Alpha2, 8.0.0.Final
Currently, when using compatibility mode with distributed caches, it is possible for
users to store keys using embedded API which hash differently to when the same key is
access via remote API. This is due to the differences in source data. For embedded, the
source object is the POJO, whereas for remote, the source object is the byte[] format of
the pojo.
When using such keys, remote APIs might go to a node which is not owner, leading to a
remote get. When two gets are executed, the first of which results in L1 entry being added
to the container, the second get result in exceptions such as this on the client:
{code}
java.lang.ClassCastException: [B cannot be cast to xxx....
{code}
This is due to over eager unboxing by the BaseTypeConverterInterceptor. I discovered this
while investigating ISPN-5449.
It would be ideal to not have scenarios where there are diverging keys but for that,
clients would need to know when compatibility is enabled, which currently is not known by
the clients. Maybe this could be negotiated with the ping command?