问题
I asked a question two weeks ago. I deployed 3 Kaa clusters follow the kaa Cluster setup guide document.The databases are MongoDB and MariaDB. When I run C Client(I make a code change that every client can login in three kaa servers in random) firstly, it can login in kaa server and send or receive event. But after I stop the Client and start it secondly, it can not send or receive event.
Then I try to do it again and again. But almost it is bad.Now I am sure it is a bug.Since then, I've done a lot of testing.Java Client ,Android Client and C Client all would appear the question that can't send and receive event in Kaa cluster sometimes.The databases are MongoDB and MariaDB.The C Client Log , Java Client Log and kaa Server Log in here.Hope that the information can play a positive role in solving the problem.
I continued to reproduce the problem and analyze.The reason is that when the client re login, its cluster endpoint information didn't update in other nodes.So when client want to send event,but its cluster endpoint information is still before, there are no address can be send.This bug may be caused by the event related code under the cluster.I hope Kaa will pay attention to this issue, because it affects the entire Kaa application development.
I have a way to fix the bug.Firstly I will describe the mechanism of sending information under kaa Cluster.Hope the information that I understood the information is correct.If there are 3 kaa cluster K1,K2,K3 and client A.The Client A login in K1 at first, Then cluster K1,K2,K3 have cluster endpoint infos about Client A .(K1 has local cluster endpoint infos about Client A,K2,K3 have remote cluster endpoint infos about Client A).Then stop and restart login in K2.K2 will send a message to K1,K3 to update the cluster endpoint infos about Client A,then K1,K3 will report all cluster endpoint infos to K2 and K2 will update the cluster endpoint infos about Client A at local. The bug is occurred in K1 and K3 do not update the cluster endpoint infos about Client A at once and cause K2 do not update the cluster endpoint infos about Client A also.
So my solution is when Client A restart login in K2 and K2 send a message to K1 and K2 ,remove the old cluster endpoint infos about Client A and add new one. Or Traversal all cluster endpoint infos(local infos and remote infos) and update cluster endpoint infos about Client A.I hope kaa team can verify the solution and fix the bug.
The Latest news is in Event can not send and receive in Kaa cluster that created by me.
来源:https://stackoverflow.com/questions/41233984/the-bug-that-cant-send-and-receive-event-in-kaa-cluster