Ah, excellent idea, won't always work but may help. I think in this case
(ephemerals) all Yonik would need to do is close the session. That will
remove all ephemerals.
kishore g wrote:
Worst case option would be to have jvm shutdownhooks
You can delete the znodes on exit. More like deleteOnExit functionality of a
On Thu, Feb 4, 2010 at 2:56 PM, Patrick Hunt <ph...@apache.org> wrote:
hah, you guys beat me to the punch. I think having some unique per client
token might also work (see my resp). Perhaps this is the ip of the host or
better (esp if multiple clients on a single host) would be some solr
specific id that uniquely identifies each node.
Benjamin Reed wrote:
i second ted's proposals! thanx ted.
there is one other option. when you create the ZooKeeper object you can
pass a session id and password. your bounced server can actually reattach to
the session. (that is why we put that constructor in.) to use it you need to
save the session id and password to a persistent store (a file) when you
first attach, and then when you restart read the id and password from the
Ted Dunning wrote:
On Thu, Feb 4, 2010 at 2:20 PM, Yonik Seeley <yo...@lucidimagination.com
There's no way to "hand over" responsibility for an ephemeral znode,
We have solr nodes create ephemeral znodes (name based on host and
The ephemeral znode takes some time to remove of course, so what
happens is that if I bounce a solr server (containing a zk client) the
ephemeral node will still exist when the server comes back up.
This problem comes up with any system that has hysteresis and needs a
point of control.
What's the best way to handle this situation? Delete and re-create?
Watch it and re-create when it does disappear?
I think you need to handle the problem of multiple search nodes coming
the same machine, possibly because the old one may have hung up.
So... I would recommend
a) if the ephemeral still exists, wait for a few more seconds to see if
b) if it goes away, create a new one and continue as normal
c) if it doesn't go away take additional action to determine if service
still running (i.e. panic and run in circles).