]
Tristan Tarrant updated ISPN-11341:
-----------------------------------
Fix Version/s: 10.1.4.Final
(was: 10.1.3.Final)
Client requests go to wrong server with binary storage
------------------------------------------------------
Key: ISPN-11341
URL:
https://issues.redhat.com/browse/ISPN-11341
Project: Infinispan
Issue Type: Bug
Components: Core, Hot Rod, Server
Affects Versions: 9.4.18.Final, 10.1.2.Final, 11.0.0.Alpha1
Reporter: Dan Berindei
Assignee: Gustavo Fernandes
Priority: Major
Fix For: 10.1.4.Final, 11.0.0.Alpha2, 9.4.19.Final
Caches with BINARY storage accept {{byte[]}} keys, but add a prefix to indicate that the
input was a {{byte[]}} and not a {{WrappedByteArray}}.
This happens in {{BinaryEncoder.toStorage()}}, before the segment of the key is computed,
so the segment computed by the server is different from the segment computed by the client
(based on the key without the prefix).
Since the client doesn't know (and shouldn't know) the server cache's storage
type, the server should always compute the segment of the key based on the {{byte[]}} sent
by the client. The simplest way to achieve that would be to make {{BinaryEncoder}} skip
the marshalling for {{byte[]}}.
The only problem is that we don't want users to put in a {{WrappedByteArray}} and get
back a {{byte[]}}, so we should disallow {{WrappedByteArray}} keys and values in {{Cache}}
methods.