Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ZOOKEEPER-2083 Remove deprecated class AuthFastLeaderElection #1171

Closed
wants to merge 7 commits into from
13 changes: 10 additions & 3 deletions zookeeper-docs/src/main/resources/markdown/zookeeperAdmin.md
Expand Up @@ -1021,9 +1021,16 @@ of servers -- that is, when deploying clusters of servers.

* *electionAlg* :
(No Java system property)
Election implementation to use. Default value is "3"
which corresponds to TCP-based version of
fast leader election.
Election implementation to use. A value of "1" corresponds to the
non-authenticated UDP-based version of fast leader election, "2"
corresponds to the authenticated UDP-based version of fast
leader election, and "3" corresponds to TCP-based version of
fast leader election. Algorithm 3 was made default in 3.2.0 and
prior versions (3.0.0 and 3.1.0) were using algorithm 1 and 2 as well.
###### Note
>The implementations of leader election 1, and 2 were
**deprecated** in 3.4.0. We will be removing them in release of 3.6.0,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What about:
Since 3.6.0 only FastLeaderElection is available, in case of upgrade you have to shutdown all of your servers and restart them with electionAlg=3 (or removing the line from the configuration file)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done pending QA

at which point only the FastLeaderElection will be available.

* *initLimit* :
(No Java system property)
Expand Down
Expand Up @@ -1111,7 +1111,7 @@ public synchronized void startLeaderElection() {
throw re;
}

this.electionAlg = createElectionAlgorithm();
this.electionAlg = createElectionAlgorithm(electionType);
}

private void startJvmPauseMonitor() {
Expand Down Expand Up @@ -1221,23 +1221,34 @@ protected Observer makeObserver(FileTxnSnapLog logFactory) throws IOException {
}

@SuppressWarnings("deprecation")
protected Election createElectionAlgorithm() {
protected Election createElectionAlgorithm(int electionAlgorithm) {
Election le = null;

final QuorumCnxManager qcm = createCnxnManager();
final QuorumCnxManager oldQcm = qcmRef.getAndSet(qcm);
if (oldQcm != null) {
LOG.warn("Clobbering already-set QuorumCnxManager (restarting leader election?)");
oldQcm.halt();
}
final QuorumCnxManager.Listener listener = qcm.listener;
if (listener != null) {
listener.start();
FastLeaderElection fle = new FastLeaderElection(this, qcm);
fle.start();
le = fle;
} else {
LOG.error("Null listener when initializing cnx manager");
//TODO: use a factory rather than a switch
switch (electionAlgorithm) {
rabi-kumar marked this conversation as resolved.
Show resolved Hide resolved
case 1:
throw new UnsupportedOperationException("Election Algorithm 1 is not supported.");
case 2:
throw new UnsupportedOperationException("Election Algorithm 2 is not supported.");
case 3:
QuorumCnxManager qcm = createCnxnManager();
QuorumCnxManager oldQcm = qcmRef.getAndSet(qcm);
if (oldQcm != null) {
LOG.warn("Clobbering already-set QuorumCnxManager (restarting leader election?)");
oldQcm.halt();
}
QuorumCnxManager.Listener listener = qcm.listener;
if (listener != null) {
listener.start();
FastLeaderElection fle = new FastLeaderElection(this, qcm);
fle.start();
le = fle;
} else {
LOG.error("Null listener when initializing cnx manager");
}
break;
default:
assert false;
}
return le;
}
Expand Down