Hi Andrew,

Thanks for reminding regarding this. It may happen that a message is “missed” 
because community members don’t have time to answer on all the questions.

In regards to your use case I would implement it int the following way.

1) Put all the messages into a special cache (let’s call it “messages” cache);

2) each server node will implement a CacheInterceptor’s [1] “onAfterPut” method;

3) when the new message arrives to the ‘Distributor’ it puts it into the 
“messages” cache;

4) after the new message is inserted CacheInterceptor.onAfterPut will be 
triggered on a primary and backup. Only primary node will move the message to 
its internal queue for further processing, backup node will ignore the update;

5) when time to process the message has come the primary node changes message’s 
state to “processing” in the cache and sets its UUID to message’s 
“processingNodeUUID” field (also storing this in the cache). Only after that 
the primary starts processing the message;

6) when the message is processed the message is deleted from the cache by 
primary.

7) if the primary fails somewhere between 5) and 6) then the rest of the nodes 
will process NODE_LEFT_EVENT and will execute SQL query like “SELECT * FROM 
messages WHERE state != processing and processingNodeUUID != failedNodeUUID”. 
After that the node will iterate over the result set and will process only 
those messages for which it’s primary according to the new topology version.

Finally, answering on your additional questions

The thing I want to ask you is why the Ignite event
'EVT_CACHE_REBALANCE_STOPPED' is triggered although the actual rebalance is
not finished yet. What does this event stands for?

This event is fired by each server node where the data is being rebalanced. 
After a server node preloads all the partitions that are assigned to it, it 
fires this event. The main point is that every server node that will be 
preloading partitions as a part of rebalancing process will fire this event.

—
Denis

[1] 
https://ignite.apache.org/releases/1.6.0/javadoc/org/apache/ignite/cache/CacheInterceptor.html
> On Jun 15, 2016, at 5:23 AM, Andrew <[email protected]> wrote:
> 
> Hi, igniters.
> 
> I've been waiting the answer but there is no reply.
> Is anybody who can answer my question here?
> 
> Sincerely,
> Andrew.
> 
> 
> 
> --
> View this message in context: 
> http://apache-ignite-users.70518.x6.nabble.com/How-do-I-know-the-cache-rebalance-is-finished-tp5219p5634.html
> Sent from the Apache Ignite Users mailing list archive at Nabble.com.

Reply via email to