I am seeing the "sending HandOverToMe to [None]" tries at startup as well.
If I change this conditional <https://github.com/akka/akka/blob/release-2.3/akka-contrib/src/main/scala/akka/contrib/pattern/ClusterSingletonManager.scala#L498> to instead read if (count <= maxHandOverRetries && previousOldestOption.isDefined) { it avoids that. Does a check like that make sense to do? On Friday, May 3, 2013 11:21:46 AM UTC+5:30, Patrik Nordwall wrote: > > The new leader that joined doesn't know who was the previous leader. > Therefore it can't send the HandOverToMe ("sending HandOverToMe to > [None]"). One might think that it can just sort the members and pick the > second (first is itself), but that is not correct in all cases. For example > when joining several nodes at the same time, that are all "before" the real > previous leader. > > This is as designed, but I was asking for the log from the previous > leader, because it is supposed to detect the new leader and > send TakeOverFromMe to the new leader, which should trigger the hand over. > > We have tests for this and I don't see the same behavior. I'm very > interested to understand if there is something wrong. Bugs are not welcome. > > > We have a new implementation on the way into master right now, which will > use the oldest member as singleton instead of the cluster leader. That > means that there will be no such unwanted hand over when joining new > members or restarting the leader. However, I'm still interested in the log. > > Thanks for reporting. > Regards, > Patrik > > > > > On Fri, May 3, 2013 at 1:29 AM, Ngoc Dao <[email protected] > <javascript:>> wrote: > >> I'm seeing that behaviour too. It is 100% reproducible with 2.2-M3. I >> think it is undesirable because whenever the old leader is shut down >> and restarted, it always wants to become the leader again, and this >> process takes tens of seconds. >> >> >> >> On 5月3日, 午前3:30, Patrik Nordwall <[email protected]> wrote: >> > Hi Hugo, can you also share the log from 2252, the previous leader. >> > /Patrik >> > >> > On Thu, May 2, 2013 at 7:38 PM, Hugo Sereno Ferreira <[email protected] >> >wrote: >> > >> > >> > >> > >> > >> > >> > >> > >> > >> > > Greetings, >> > >> > > *(this first appeared in >> > >http://stackoverflow.com/questions/16305194/akka-2-2-clustersingleton. >> .. >> > > )* >> > >> > > I'm using Akka 2.2 contrib's project ClusterSingletonManager to >> guarantee >> > > there is always one and just one specific type of actor >> > > (master/orchestrator) in a cluster. However, I've observed an odd >> behaviour >> > > (which, incidentally, may be expected, but can't understand why). >> Whenever >> > > a master drops out of the cluster and joins in later, the following >> > > sequence of actions occur: >> > >> > > [INFO] [04/30/2013 17:47:35.805] >> > > [ClusterSystem-akka.actor.default-dispatcher-9] >> > > [akka://ClusterSystem/system/cluster/core/daemon] Cluster Node >> [akka.tcp:// >> > > [email protected]:2551] - Welcome from [akka.tcp:// >> > > [email protected]:2552] >> > > [INFO] [04/30/2013 17:47:48.703] >> > > [ClusterSystem-akka.actor.default-dispatcher-8] >> > > [akka://ClusterSystem/user/singleton] Member removed [akka.tcp:// >> > > [email protected]:52435] >> > > [INFO] [04/30/2013 17:47:48.712] >> > > [ClusterSystem-akka.actor.default-dispatcher-2] >> > > [akka://ClusterSystem/user/singleton] ClusterSingletonManager state >> change >> > > [Start -> BecomingLeader] >> > > [INFO] [04/30/2013 17:47:49.752] >> > > [ClusterSystem-akka.actor.default-dispatcher-9] >> > > [akka://ClusterSystem/user/singleton] Retry [1], sending HandOverToMe >> to >> > > [None] >> > > [INFO] [04/30/2013 17:47:50.850] >> > > [ClusterSystem-akka.actor.default-dispatcher-21] >> > > [akka://ClusterSystem/user/singleton] Retry [2], sending HandOverToMe >> to >> > > [None] >> > > [INFO] [04/30/2013 17:47:51.951] >> > > [ClusterSystem-akka.actor.default-dispatcher-20] >> > > [akka://ClusterSystem/user/singleton] Retry [3], sending HandOverToMe >> to >> > > [None] >> > > [INFO] [04/30/2013 17:47:53.049] >> > > [ClusterSystem-akka.actor.default-dispatcher-3] >> > >> > > ... >> > >> > > [INFO] [04/30/2013 17:48:10.650] >> > > [ClusterSystem-akka.actor.default-dispatcher-21] >> > > [akka://ClusterSystem/user/singleton] Retry [20], sending >> HandOverToMe to >> > > [None] >> > > [INFO] [04/30/2013 17:48:11.751] >> > > [ClusterSystem-akka.actor.default-dispatcher-4] >> > > [akka://ClusterSystem/user/singleton] Timeout in BecomingLeader. >> Previous >> > > leader unknown, removed and no TakeOver request. >> > > [INFO] [04/30/2013 17:48:11.752] >> > > [ClusterSystem-akka.actor.default-dispatcher-4] >> > > [akka://ClusterSystem/user/singleton] Singleton manager [akka.tcp:// >> > > [email protected]:2551] starting singleton actor >> > > [INFO] [04/30/2013 17:48:11.754] >> > > [ClusterSystem-akka.actor.default-dispatcher-4] >> > > [akka://ClusterSystem/user/singleton] ClusterSingletonManager state >> change >> > > [BecomingLeader -> Leader] >> > >> > > Why is it attempting to send an HandOverToMe to [None]? It takes >> about 20 >> > > seconds (20 retries) until it becomes the new leader, though in this >> > > particular situation the previous one was well known... >> > >> > > Cheers, >> > >> > > Hugo >> > >> > > -- >> > > >>>>>>>>>> Read the docs:http://akka.io/docs/ >> > > >>>>>>>>>> Check the FAQ:http://akka.io/faq/ >> > > >>>>>>>>>> Search the archives: >> https://groups.google.com/group/akka-user >> > > --- >> > > You received this message because you are subscribed to the Google >> Groups >> > > "Akka User List" group. >> > > To unsubscribe from this group and stop receiving emails from it, >> send an >> > > email to [email protected] <javascript:>. >> > > To post to this group, send email to [email protected] >> <javascript:>. >> > > Visit this group athttp://groups.google.com/group/akka-user?hl=en. >> > > For more options, visithttps://groups.google.com/groups/opt_out. >> > >> > -- >> > >> > Patrik Nordwall >> > Typesafe <http://typesafe.com/> - The software stack for applications >> that >> > scale >> > Twitter: @patriknw >> >> -- >> >>>>>>>>>> Read the docs: http://akka.io/docs/ >> >>>>>>>>>> Check the FAQ: http://akka.io/faq/ >> >>>>>>>>>> Search the archives: >> https://groups.google.com/group/akka-user >> --- >> You received this message because you are subscribed to the Google Groups >> "Akka User List" group. >> To unsubscribe from this group and stop receiving emails from it, send an >> email to [email protected] <javascript:>. >> To post to this group, send email to [email protected] >> <javascript:>. >> Visit this group at http://groups.google.com/group/akka-user?hl=en. >> For more options, visit https://groups.google.com/groups/opt_out. >> >> >> > > > -- > > Patrik Nordwall > Typesafe <http://typesafe.com/> - The software stack for applications > that scale > Twitter: @patriknw > > -- >>>>>>>>>> Read the docs: http://akka.io/docs/ >>>>>>>>>> Check the FAQ: >>>>>>>>>> http://doc.akka.io/docs/akka/current/additional/faq.html >>>>>>>>>> Search the archives: https://groups.google.com/group/akka-user --- You received this message because you are subscribed to the Google Groups "Akka User List" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/akka-user. For more options, visit https://groups.google.com/d/optout.
