Reza Taroosheh created IGNITE-29226:
---------------------------------------
Summary: ContinuousQueryWithTransformer on a keep-binary cache
delivers a remote node's transformed events as BinaryObject
Key: IGNITE-29226
URL: https://issues.apache.org/jira/browse/IGNITE-29226
Project: Ignite
Issue Type: Bug
Reporter: Reza Taroosheh
Assignee: Reza Taroosheh
A {{ContinuousQueryWithTransformer}} registered on {{cache.withKeepBinary()}}
gives its local listener the transformer's result class only for keys whose
primary is the listener's node. Events transformed on another node arrive as
{{BinaryObject}}, so one listener gets a mix of both, and a listener that reads
its events as the result class throws {{ClassCastException}}. Without
{{withKeepBinary()}}, every event arrives as the result class.
Steps:
# Start two server nodes with a {{PARTITIONED}} cache.
# On node 0, register a {{ContinuousQueryWithTransformer}} on
{{cache.withKeepBinary()}}, with a remote transformer that returns an object of
a user class (e.g., {{PersonId}}, built from the event's key or value).
# Put one key whose primary is node 0 and one whose primary is node 1.
Actual: the listener gets a {{PersonId}} for the first key and a
{{BinaryObjectImpl}} for the second.
Expected: a {{PersonId}} for both. Keep-binary mode controls how the
transformer receives the cache's keys and values; it should not change the
transformer's result type.
Reproduced on 2.17.0 and 2.18.0 (reported on the dev list:
https://lists.apache.org/thread/hrr9s73y6v0f853qdt63rb6dh1hjhn3t), and on
master by a new test.
The existing keep-binary tests in
{{CacheContinuousWithTransformerReplicatedSelfTest}} don't catch it: they run
on a single server node and transform to a {{String}}.
Compatibility: the fix changes the type a listener receives for remote events
on a keep-binary cache. Code that handles {{BinaryObject}} there would get the
result class instead.
--
This message was sent by Atlassian Jira
(v10.3.26#10030026)