Participant selection mechanism when implementing Java leader election using zookeeper.

2019-12-03 Thread Isuru Boyagane
I read about leader election using zookeeper.

 https://zookeeper.apache.org/doc/current/recipes.html#sc_leaderElection

I have a small question ro ask.
After a node creared "/election" node every node creates child nodes with
sequential and ephemeral flags.

In what condition nodes decide to select all the child nodes and elect
smallest one as the leader. In other words "what prevents a slightly late
node joining the election". Is it a timeout? If so how it is handled in
Zookeeper internally?

Please advise.
Thank you.


RE: java.lang.NullPointerException on some commands (stats, conf)

2019-12-03 Thread Mike Smotritsky
Hi Enrico, I'd really love to have 3.5.6 released with this fix in. (Thanks to 
Mate for the very quick fix!)
Cause my my Solr cluster keeps complaining about the Zookeeper state.

Thanks and Regards,
Mike



-Original Message-
From: Enrico Olivelli [mailto:eolive...@gmail.com] 
Sent: Tuesday, December 03, 2019 10:07 AM
To: UserZooKeeper
Subject: Re: java.lang.NullPointerException on some commands (stats, conf)

Mike,
just to be clear:  'we can cut new releases from 3.5 branch' means that we
are able to do it.

But there are no plans to do it right now.

If you need a release please let us know, we have just cut 3.5.6, there
aren't so many changes cherry picked to branch-3.5

Enrico


Il giorno lun 2 dic 2019 alle ore 18:45 Mike Smotritsky <
mikesmotrit...@ongov.net> ha scritto:

> Hi Enrico,
>
> Thank you very much, that would be great!
>
> Thanks and Regards,
>
> Mike
>
> -Original Message-
> From: Enrico Olivelli [mailto:eolive...@gmail.com]
> Sent: Monday, December 02, 2019 10:56 AM
> To: UserZooKeeper
> Subject: Re: java.lang.NullPointerException on some commands (stats, conf)
>
> Mike,
> we can cut new releases from 3.5 branch.
> It is current stable branch.
>
> We can cherry pick Mate's fix to branch-3.5
>
> Enrico
>
> Il giorno lun 2 dic 2019 alle ore 16:36 Mike Smotritsky <
> mikesmotrit...@ongov.net> ha scritto:
>
> > Hey Mate, on  the jira issue it says that the fix will come in with 3.6.0
> > The thing is that I'm using Zookeeper with SOLR and I'm afraid that 3.6
> > will be incompatible with SOLR 8.x (I don't know what new features will
> be
> > included in 3.6)
> >
> > You are not planning one more maintenance release for 3.5?
> >
> > Thanks and Regards,
> > Mike
> >
> >
> > -Original Message-
> > From: Mate Szalay-Beko [mailto:msza...@cloudera.com.INVALID]
> > Sent: Thursday, November 28, 2019 11:12 AM
> > To: user@zookeeper.apache.org
> > Subject: Re: java.lang.NullPointerException on some commands (stats,
> conf)
> >
> > FYI: https://jira.apache.org/jira/browse/ZOOKEEPER-3633
> >
> >
> > On Thu, Nov 28, 2019 at 4:53 PM Mate Szalay-Beko 
> > wrote:
> >
> > > Hi Mike,
> > >
> > > I was able to reproduce the issue. I guess in your config you are using
> > > client SSL. You defined 'secureClientPort', but no regular
> 'clientPort'.
> > > I think we missed to test the admin API for this case... I will create
> a
> > > Jira issue and try to fix it soon.
> > >
> > > Thanks for your time on testing ZooKeeper and reporting the problem! :)
> > >
> > > Mate
> > >
> > > On Wed, Nov 27, 2019 at 8:56 PM Mike Smotritsky <
> > mikesmotrit...@ongov.net>
> > > wrote:
> > >
> > >> Hi, I've installed 3.5.5 and 3.5.6 3-server cluster. Secured and using
> > >> SSLQuorum.
> > >> All works well except that I'm getting NullPointerException when
> > invoking
> > >> certain commands through Web AdminServer (stats,conf)
> > >> Others works well.
> > >> 
> > >> java.lang.NullPointerException
> > >> at
> > >>
> >
> org.apache.zookeeper.server.ZooKeeperServer.getConf(ZooKeeperServer.java:220)
> > >> at
> > >>
> >
> org.apache.zookeeper.server.admin.Commands$ConfCommand.run(Commands.java:162)
> > >> at
> > >>
> org.apache.zookeeper.server.admin.Commands.runCommand(Commands.java:95)
> > >> at
> > >>
> >
> org.apache.zookeeper.server.admin.JettyAdminServer$CommandServlet.doGet(JettyAdminServer.java:175)
> > >> at
> javax.servlet.http.HttpServlet.service(HttpServlet.java:687)
> > >> at
> javax.servlet.http.HttpServlet.service(HttpServlet.java:790)
> > >> at
> > >> org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:873)
> > >> at
> > >>
> >
> org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:542)
> > >> at
> > >>
> >
> org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:255)
> > >> at
> > >>
> >
> org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:1700)
> > >> at
> > >>
> >
> org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:255)
> > >> at
> > >>
> >
> org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1345)
> > >> at
> > >>
> >
> org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:203)
> > >> at
> > >>
> > org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:480)
> > >> at
> > >>
> >
> org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:1667)
> > >> at
> > >>
> >
> org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:201)
> > >> at
> > >>
> >
> org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1247)
> > >> at
> > >>
> >
> org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:144)
> > >> at
> > >>
> >
> 

Re: java.lang.NullPointerException on some commands (stats, conf)

2019-12-03 Thread Enrico Olivelli
Mike,
just to be clear:  'we can cut new releases from 3.5 branch' means that we
are able to do it.

But there are no plans to do it right now.

If you need a release please let us know, we have just cut 3.5.6, there
aren't so many changes cherry picked to branch-3.5

Enrico


Il giorno lun 2 dic 2019 alle ore 18:45 Mike Smotritsky <
mikesmotrit...@ongov.net> ha scritto:

> Hi Enrico,
>
> Thank you very much, that would be great!
>
> Thanks and Regards,
>
> Mike
>
> -Original Message-
> From: Enrico Olivelli [mailto:eolive...@gmail.com]
> Sent: Monday, December 02, 2019 10:56 AM
> To: UserZooKeeper
> Subject: Re: java.lang.NullPointerException on some commands (stats, conf)
>
> Mike,
> we can cut new releases from 3.5 branch.
> It is current stable branch.
>
> We can cherry pick Mate's fix to branch-3.5
>
> Enrico
>
> Il giorno lun 2 dic 2019 alle ore 16:36 Mike Smotritsky <
> mikesmotrit...@ongov.net> ha scritto:
>
> > Hey Mate, on  the jira issue it says that the fix will come in with 3.6.0
> > The thing is that I'm using Zookeeper with SOLR and I'm afraid that 3.6
> > will be incompatible with SOLR 8.x (I don't know what new features will
> be
> > included in 3.6)
> >
> > You are not planning one more maintenance release for 3.5?
> >
> > Thanks and Regards,
> > Mike
> >
> >
> > -Original Message-
> > From: Mate Szalay-Beko [mailto:msza...@cloudera.com.INVALID]
> > Sent: Thursday, November 28, 2019 11:12 AM
> > To: user@zookeeper.apache.org
> > Subject: Re: java.lang.NullPointerException on some commands (stats,
> conf)
> >
> > FYI: https://jira.apache.org/jira/browse/ZOOKEEPER-3633
> >
> >
> > On Thu, Nov 28, 2019 at 4:53 PM Mate Szalay-Beko 
> > wrote:
> >
> > > Hi Mike,
> > >
> > > I was able to reproduce the issue. I guess in your config you are using
> > > client SSL. You defined 'secureClientPort', but no regular
> 'clientPort'.
> > > I think we missed to test the admin API for this case... I will create
> a
> > > Jira issue and try to fix it soon.
> > >
> > > Thanks for your time on testing ZooKeeper and reporting the problem! :)
> > >
> > > Mate
> > >
> > > On Wed, Nov 27, 2019 at 8:56 PM Mike Smotritsky <
> > mikesmotrit...@ongov.net>
> > > wrote:
> > >
> > >> Hi, I've installed 3.5.5 and 3.5.6 3-server cluster. Secured and using
> > >> SSLQuorum.
> > >> All works well except that I'm getting NullPointerException when
> > invoking
> > >> certain commands through Web AdminServer (stats,conf)
> > >> Others works well.
> > >> 
> > >> java.lang.NullPointerException
> > >> at
> > >>
> >
> org.apache.zookeeper.server.ZooKeeperServer.getConf(ZooKeeperServer.java:220)
> > >> at
> > >>
> >
> org.apache.zookeeper.server.admin.Commands$ConfCommand.run(Commands.java:162)
> > >> at
> > >>
> org.apache.zookeeper.server.admin.Commands.runCommand(Commands.java:95)
> > >> at
> > >>
> >
> org.apache.zookeeper.server.admin.JettyAdminServer$CommandServlet.doGet(JettyAdminServer.java:175)
> > >> at
> javax.servlet.http.HttpServlet.service(HttpServlet.java:687)
> > >> at
> javax.servlet.http.HttpServlet.service(HttpServlet.java:790)
> > >> at
> > >> org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:873)
> > >> at
> > >>
> >
> org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:542)
> > >> at
> > >>
> >
> org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:255)
> > >> at
> > >>
> >
> org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:1700)
> > >> at
> > >>
> >
> org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:255)
> > >> at
> > >>
> >
> org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1345)
> > >> at
> > >>
> >
> org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:203)
> > >> at
> > >>
> > org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:480)
> > >> at
> > >>
> >
> org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:1667)
> > >> at
> > >>
> >
> org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:201)
> > >> at
> > >>
> >
> org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1247)
> > >> at
> > >>
> >
> org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:144)
> > >> at
> > >>
> >
> org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:132)
> > >> at org.eclipse.jetty.server.Server.handle(Server.java:505)
> > >> at
> > >> org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:370)
> > >> at
> > >>
> >
> org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:267)
> > >> at org.eclipse.jetty.io
> > >>
> 

Re: About ZooKeeper Dynamic Reconfiguration

2019-12-03 Thread Gao,Wei
Hi oo4load,
  I have a question which confuses me quite a long time.
  As is known to us all, ZK servers frequently take snapshots while
processing requests.
When a ZK server replays a snapshot which contains a transaction which has
been executed before this snapshot, the transaction will be executed two
times. However if a version number is specified in the transaction, it will
not match the current version number when replaying the transaction.
  How does ZK server solve this problem?
  Really look forward to your answers!
  Thank you.





--
Sent from: http://zookeeper-user.578899.n2.nabble.com/