Re: CacheContinuousQuery did not work after the second servernodejoinned into the topology.

2016-10-13 Thread Nikolai Tikhonov
Hi Lin,

In your case autoUnsubsribe flag should be set to false.

Could you describe how change performance after you enable cache events?

Thanks,
Nikolay

On Mon, Oct 10, 2016 at 6:59 AM, Lin  wrote:

> Hi Nikolay,
>
> I have a requirement on CQ to implement some functions like event
> listener. The client initializes and adds one listener to ther cluster, and
> hope to can recevie the expected CacheEntryEvent persistently without
> considering the leaving or adding nodes.
>
> firstly, i implement this feacture with the Ignite.events, but the
> performance is unacceptable.
>
> Any advices are welcome.
>
> Lin.
>
>
> -- Original --
> *From: * "Nikolai Tikhonov";;
> *Date: * Fri, Oct 7, 2016 09:34 PM
> *To: * "user";
> *Subject: * Re: CacheContinuousQuery did not work after the second
> servernodejoinned into the topology.
>
> Hi Lin!
>
> It's bug. I've create ticket and you can track progress there
> https://issues.apache.org/jira/browse/IGNITE-4047. How workaround you can
> start CQ with setAutoUnsubscribe(true).
>
> BTW: Why you use CQ with auto unsubscribe false?
>
> Thanks,
> Nikolay
>
> On Fri, Sep 30, 2016 at 7:18 AM, Lin  wrote:
>
>> Hi Vladislav,
>>
>> Thank you for your response. I can reproduce this issue with the maven
>> project you gave.
>>
>> My problems is that: after the second server node joinned into the
>> topology, I put some data into the cache, the result is that the CQ query
>> works in the first and second server nodes (the remote filter procuduced
>> the system output as expceted), but the CQ query client node was not
>> working as expected ( the CacheEntryUpdatedListener was not trigged any
>> more).
>>
>> I have modified the pom with my enviroment (only some modification about
>> package versions), and add some shell script in windows to reproduce the
>> issue easily.
>> My enviroment is ignite ver. 1.6.0#20160518-sha1:0b22c45b, the details
>> can be found in the log file in "log/s1.debug.log" which was produced with
>> the "-X" parameter in maven (see script server.bat).
>>
>> Here is the steps about how to reproduce the issue in my envrioment.
>> 1. mvn compile, the produce the target classes and ignite-*.xml.
>> 2. the first test
>> 2.1 run the server.bat to start the first server node, the console
>> outputs were piped into s1.log.
>> 2.2 run the CQClient.bat to create a client with cq query, when the
>> CacheContinuousQueryEvent is received, it will produce outputs like
>> `
>> sys-#5%null% receive CacheEntryEvent CacheContinuousQueryEvent
>> [evtType=CREATED, key=5, newVal=0, oldVal=null]
>> sys-#5%null% receive CacheEntryEvent CacheContinuousQueryEvent
>> [evtType=UPDATED, key=5, newVal=1, oldVal=0]
>> `
>> in the client node, and the server node will produce outputs like
>> `
>> CacheEntryEventRemoteFilter.evaluate CacheContinuousQueryEvent
>> [evtType=CREATED, key=5, newVal=0, oldVal=null], with ret true
>> CacheEntryEventRemoteFilter.evaluate CacheContinuousQueryEvent
>> [evtType=UPDATED, key=5, newVal=1, oldVal=0], with ret true
>> `
>> 2.3 run the DataClient.bat to put 2 kv pairs( (5, 0), (5,1)) into given
>> cache and exit. This will cause the server1 producing outputs from remote
>> filter
>> `
>> CacheEntryEventRemoteFilter.evaluate CacheContinuousQueryEvent
>> [evtType=CREATED, key=5, newVal=0, oldVal=null], with ret true
>> CacheEntryEventRemoteFilter.evaluate CacheContinuousQueryEvent
>> [evtType=UPDATED, key=5, newVal=1, oldVal=0], with ret true
>> `
>> and cause the CQ client producing outputs from CacheEntryUpdatedListener
>> in the client,
>> `
>> sys-#5%null% receive CacheEntryEvent CacheContinuousQueryEvent
>> [evtType=CREATED, key=5, newVal=0, oldVal=null]
>> sys-#5%null% receive CacheEntryEvent CacheContinuousQueryEvent
>> [evtType=UPDATED, key=5, newVal=1, oldVal=0]
>> `
>>
>>
>> 3. continue to start the second test, and the issue is occurred,
>> 3.1 run the server.bat to start the second server node, and piped its
>> output into s2.log.
>> 3.2 run the DataClient.bat to put the same 2 kv pairs into cache, and in
>> server1 and server2's outputs, the remote filters output are the same,
>> `
>> CacheEntryEventRemoteFilter.evaluate CacheContinuousQueryEvent
>> [evtType=UPDATED, key=5, newVal=0, oldVal=1], with ret true
>> CacheEntryEventRemoteFilter.evaluate CacheContinuousQueryEvent
>> [evtType=UPDATED, key=5, newVal=1, oldVal=0], with ret true
>> `
>>

Re: CacheContinuousQuery did not work after the second servernodejoinned into the topology.

2016-10-09 Thread Lin
Hi Nikolay,


I have a requirement on CQ to implement some functions like event listener. The 
client initializes and adds one listener to ther cluster, and hope to can 
recevie the expected CacheEntryEvent persistently without considering the 
leaving or adding nodes.


firstly, i implement this feacture with the Ignite.events, but the performance 
is unacceptable.


Any advices are welcome.


Lin.




-- Original --
From:  "Nikolai Tikhonov";;
Date:  Fri, Oct 7, 2016 09:34 PM
To:  "user"; 

Subject:  Re: CacheContinuousQuery did not work after the second 
servernodejoinned into the topology.



Hi Lin!

It's bug. I've create ticket and you can track progress there 
https://issues.apache.org/jira/browse/IGNITE-4047. How workaround you can start 
CQ with setAutoUnsubscribe(true).


BTW: Why you use CQ with auto unsubscribe false?


Thanks, 
Nikolay


On Fri, Sep 30, 2016 at 7:18 AM, Lin  wrote:
Hi Vladislav,


Thank you for your response. I can reproduce this issue with the maven project 
you gave.


My problems is that: after the second server node joinned into the topology, I 
put some data into the cache, the result is that the CQ query works in the 
first and second server nodes (the remote filter procuduced the system output 
as expceted), but the CQ query client node was not working as expected ( the 
CacheEntryUpdatedListener was not trigged any more).


I have modified the pom with my enviroment (only some modification about 
package versions), and add some shell script in windows to reproduce the issue 
easily.
My enviroment is ignite ver. 1.6.0#20160518-sha1:0b22c45b, the details can be 
found in the log file in "log/s1.debug.log" which was produced with the "-X" 
parameter in maven (see script server.bat).


Here is the steps about how to reproduce the issue in my envrioment.
1. mvn compile, the produce the target classes and ignite-*.xml.
2. the first test
2.1 run the server.bat to start the first server node, the console outputs were 
piped into s1.log.
2.2 run the CQClient.bat to create a client with cq query, when the 
CacheContinuousQueryEvent is received, it will produce outputs like
`
sys-#5%null% receive CacheEntryEvent CacheContinuousQueryEvent 
[evtType=CREATED, key=5, newVal=0, oldVal=null]
sys-#5%null% receive CacheEntryEvent CacheContinuousQueryEvent 
[evtType=UPDATED, key=5, newVal=1, oldVal=0]
`
in the client node, and the server node will produce outputs like
`
CacheEntryEventRemoteFilter.evaluate CacheContinuousQueryEvent 
[evtType=CREATED, key=5, newVal=0, oldVal=null], with ret true
CacheEntryEventRemoteFilter.evaluate CacheContinuousQueryEvent 
[evtType=UPDATED, key=5, newVal=1, oldVal=0], with ret true

`
2.3 run the DataClient.bat to put 2 kv pairs( (5, 0), (5,1)) into given cache 
and exit. This will cause the server1 producing outputs from remote filter
`
CacheEntryEventRemoteFilter.evaluate CacheContinuousQueryEvent 
[evtType=CREATED, key=5, newVal=0, oldVal=null], with ret true
CacheEntryEventRemoteFilter.evaluate CacheContinuousQueryEvent 
[evtType=UPDATED, key=5, newVal=1, oldVal=0], with ret true

`
and cause the CQ client producing outputs from CacheEntryUpdatedListener in the 
client,
`
sys-#5%null% receive CacheEntryEvent CacheContinuousQueryEvent 
[evtType=CREATED, key=5, newVal=0, oldVal=null]
sys-#5%null% receive CacheEntryEvent CacheContinuousQueryEvent 
[evtType=UPDATED, key=5, newVal=1, oldVal=0]

`




3. continue to start the second test, and the issue is occurred,
3.1 run the server.bat to start the second server node, and piped its output 
into s2.log.
3.2 run the DataClient.bat to put the same 2 kv pairs into cache, and in 
server1 and server2's outputs, the remote filters output are the same,
`
CacheEntryEventRemoteFilter.evaluate CacheContinuousQueryEvent 
[evtType=UPDATED, key=5, newVal=0, oldVal=1], with ret true
CacheEntryEventRemoteFilter.evaluate CacheContinuousQueryEvent 
[evtType=UPDATED, key=5, newVal=1, oldVal=0], with ret true

`
but in the CQClient's output, there is nothing, the expected output should be 
something like
`
sys-#5%null% receive CacheEntryEvent CacheContinuousQueryEvent 
[evtType=UPDATED, key=5, newVal=0, oldVal=1]
sys-#5%null% receive CacheEntryEvent CacheContinuousQueryEvent 
[evtType=UPDATED, key=5, newVal=1, oldVal=0]

`

but not.


It looks like that the remote filter is initialized in the server2 node with 
method 
org.apache.ignite.internal.processors.cache.query.continuous.CacheContinuousQueryHandlerV2#readExternal,
but the links between remote filter and local listener is broken? The 
CacheContinuousQueryEvent didn't pass to the client.


And in the meanwhile, why the two server node process the same data?


Hope for your help.




Lin.