Home | About | Sematext search-lucene.com search-hadoop.com
NEW: Monitor These Apps!
elasticsearch, apache solr, apache hbase, hadoop, redis, casssandra, amazon cloudwatch, mysql, memcached, apache kafka, apache zookeeper, apache storm, ubuntu, centOS, red hat, debian, puppet labs, java, senseiDB
 Search Hadoop and all its subprojects:

Switch to Threaded View
Zookeeper >> mail # user >> Leader election in C# client


Copy link to this message
-
Leader election in C# client
Hi,

I was looking at the leader election algorithm in the .NET client at https://github.com/ewhauser/zookeeper/blob/trunk/src/dotnet/ZooKeeperNet.Recipes/LeaderElection.cs

There is a point I don't understand and I was wondering if someone could clarify for me. The recipe creates ephemeral nodes of the form "election-<sessionid>-<sequentialid>", I think to be able to see if it has already created the node (perhaps due to a retry?). However, doesn't having the session id in the node name then throw out the sorting of the nodes in the next step, to find the previous node to watch? I'd have thought it would then be sorting by session id and not sequential id? Perhaps that doesn't matter as long as only one node gets picked?

Thanks,
Ben

Ben Young . Senior Software Engineer . Adaptiv . Position, Risk & Operations . SunGard . Enterprise House, Histon, Cambridge, CB24 9ZR .  Tel +44 (0) 1223 266042 . [EMAIL PROTECTED] . www.sungard.com

 
NEW: Monitor These Apps!
elasticsearch, apache solr, apache hbase, hadoop, redis, casssandra, amazon cloudwatch, mysql, memcached, apache kafka, apache zookeeper, apache storm, ubuntu, centOS, red hat, debian, puppet labs, java, senseiDB