[ 
https://issues.apache.org/jira/browse/IGNITE-29226?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18133859#comment-18133859
 ] 

Reza Taroosheh commented on IGNITE-29226:
-----------------------------------------

Reproducer: 
[1ec3952184|https://github.com/apache/ignite/pull/13770/commits/1ec3952184350b25fc40c4c9a18b8199b0397a92]
 adds {{CacheContinuousWithTransformerKeepBinaryTest}}, which fails on master: 
the remote key's event reaches the listener as {{BinaryObjectImpl}} instead of 
{{PersonId}}. The fix will come as a separate commit on top of it in the same 
draft PR, so you can check the test before and after the fix.

> 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
>            Priority: Major
>          Time Spent: 10m
>  Remaining Estimate: 0h
>
> 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)

Reply via email to