You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@zookeeper.apache.org by GitBox <gi...@apache.org> on 2021/06/07 08:46:35 UTC
[GitHub] [zookeeper] zhongxiongzeng opened a new pull request #1709: ZOOKEEPER-4312: remove unnecessary code
zhongxiongzeng opened a new pull request #1709:
URL: https://github.com/apache/zookeeper/pull/1709
The result of this line of code is not used, this code is uncessary
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [zookeeper] maoling commented on pull request #1709: ZOOKEEPER-4312: remove unnecessary code
Posted by GitBox <gi...@apache.org>.
maoling commented on pull request #1709:
URL: https://github.com/apache/zookeeper/pull/1709#issuecomment-855961842
@chingchan1996 PTAL. What you want is the following ?
```
* The leader election algorithm does not provide the ability of electing a leader from a single instance
* which is in a configuration of 2 instances.
* */
if (self.getQuorumVerifier() instanceof QuorumOracleMaj
&& self.getQuorumVerifier().revalidateVoteset(voteSet, notTimeout != minNotificationInterval)) {
setPeerState(proposedLeader, voteSet);
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [zookeeper] asfgit closed pull request #1709: ZOOKEEPER-4312: remove unnecessary code
Posted by GitBox <gi...@apache.org>.
asfgit closed pull request #1709:
URL: https://github.com/apache/zookeeper/pull/1709
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@zookeeper.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [zookeeper] chingchan1996 commented on a change in pull request #1709: ZOOKEEPER-4312: remove unnecessary code
Posted by GitBox <gi...@apache.org>.
chingchan1996 commented on a change in pull request #1709:
URL: https://github.com/apache/zookeeper/pull/1709#discussion_r654108341
##########
File path: zookeeper-server/src/main/java/org/apache/zookeeper/server/quorum/FastLeaderElection.java
##########
@@ -976,26 +976,9 @@ public Vote lookForLeader() throws InterruptedException {
/*
* Exponential backoff
*/
- int tmpTimeOut = notTimeout * 2;
- notTimeout = Math.min(tmpTimeOut, maxNotificationInterval);
-
- /*
- * When a leader failure happens on a master, the backup will be supposed to receive the honour from
- * Oracle and become a leader, but the honour is likely to be delay. We do a re-check once timeout happens
- *
- * The leader election algorithm does not provide the ability of electing a leader from a single instance
- * which is in a configuration of 2 instances.
- * */
- self.getQuorumVerifier().revalidateVoteset(voteSet, notTimeout != minNotificationInterval);
- if (self.getQuorumVerifier() instanceof QuorumOracleMaj && voteSet != null && voteSet.hasAllQuorums() && notTimeout != minNotificationInterval) {
Review comment:
`voteSet != null && voteSet.hasAllQuorums() && notTimeout != minNotificationInterval`
actually is as same as
`self.getQuorumVerifier().revalidateVoteset(voteSet, notTimeout != minNotificationInterval);`
what @maoling suggested is to remove line 989, and replace the second part of the condition with the function.
The If-statement on line 990 shall remain.
##########
File path: zookeeper-server/src/main/java/org/apache/zookeeper/server/quorum/FastLeaderElection.java
##########
@@ -976,26 +976,9 @@ public Vote lookForLeader() throws InterruptedException {
/*
* Exponential backoff
*/
- int tmpTimeOut = notTimeout * 2;
- notTimeout = Math.min(tmpTimeOut, maxNotificationInterval);
-
- /*
- * When a leader failure happens on a master, the backup will be supposed to receive the honour from
- * Oracle and become a leader, but the honour is likely to be delay. We do a re-check once timeout happens
- *
- * The leader election algorithm does not provide the ability of electing a leader from a single instance
- * which is in a configuration of 2 instances.
- * */
- self.getQuorumVerifier().revalidateVoteset(voteSet, notTimeout != minNotificationInterval);
- if (self.getQuorumVerifier() instanceof QuorumOracleMaj && voteSet != null && voteSet.hasAllQuorums() && notTimeout != minNotificationInterval) {
Review comment:
`voteSet != null && voteSet.hasAllQuorums() && notTimeout != minNotificationInterval`
actually is as same as
`self.getQuorumVerifier().revalidateVoteset(voteSet, notTimeout != minNotificationInterval);`
what @maoling suggested is to remove line 989, and replace the second part of the condition with the method.
The If-statement on line 990 shall remain.
##########
File path: zookeeper-server/src/main/java/org/apache/zookeeper/server/quorum/FastLeaderElection.java
##########
@@ -976,26 +976,9 @@ public Vote lookForLeader() throws InterruptedException {
/*
* Exponential backoff
*/
- int tmpTimeOut = notTimeout * 2;
- notTimeout = Math.min(tmpTimeOut, maxNotificationInterval);
-
- /*
- * When a leader failure happens on a master, the backup will be supposed to receive the honour from
- * Oracle and become a leader, but the honour is likely to be delay. We do a re-check once timeout happens
- *
- * The leader election algorithm does not provide the ability of electing a leader from a single instance
- * which is in a configuration of 2 instances.
- * */
- self.getQuorumVerifier().revalidateVoteset(voteSet, notTimeout != minNotificationInterval);
- if (self.getQuorumVerifier() instanceof QuorumOracleMaj && voteSet != null && voteSet.hasAllQuorums() && notTimeout != minNotificationInterval) {
Review comment:
thanks! I appreciate your effort :). That was my miss when I introduced these codes a while ago.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [zookeeper] chingchan1996 commented on pull request #1709: ZOOKEEPER-4312: remove unnecessary code
Posted by GitBox <gi...@apache.org>.
chingchan1996 commented on pull request #1709:
URL: https://github.com/apache/zookeeper/pull/1709#issuecomment-856374977
Yes. I think it is redundant.
@maoling is right.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [zookeeper] zhongxiongzeng commented on pull request #1709: ZOOKEEPER-4312: remove unnecessary code
Posted by GitBox <gi...@apache.org>.
zhongxiongzeng commented on pull request #1709:
URL: https://github.com/apache/zookeeper/pull/1709#issuecomment-866465121
> @zhongxiongzeng if no other concerns, I'll merge it at this weekend(06-26). Cc @chingchan1996
no other concerns
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [zookeeper] maoling commented on pull request #1709: ZOOKEEPER-4312: remove unnecessary code
Posted by GitBox <gi...@apache.org>.
maoling commented on pull request #1709:
URL: https://github.com/apache/zookeeper/pull/1709#issuecomment-865943804
@zhongxiongzeng if no other concerns, I'll merge it at this weekend(06-26). Cc @chingchan1996
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [zookeeper] chingchan1996 commented on pull request #1709: ZOOKEEPER-4312: remove unnecessary code
Posted by GitBox <gi...@apache.org>.
chingchan1996 commented on pull request #1709:
URL: https://github.com/apache/zookeeper/pull/1709#issuecomment-866012114
> @zhongxiongzeng if no other concerns, I'll merge it at this weekend(06-26). Cc @chingchan1996
+1
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [zookeeper] maoling commented on pull request #1709: ZOOKEEPER-4312: remove unnecessary code
Posted by GitBox <gi...@apache.org>.
maoling commented on pull request #1709:
URL: https://github.com/apache/zookeeper/pull/1709#issuecomment-869115347
@zhongxiongzeng
Thanks for your contribution.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@zookeeper.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [zookeeper] zhongxiongzeng commented on a change in pull request #1709: ZOOKEEPER-4312: remove unnecessary code
Posted by GitBox <gi...@apache.org>.
zhongxiongzeng commented on a change in pull request #1709:
URL: https://github.com/apache/zookeeper/pull/1709#discussion_r654109787
##########
File path: zookeeper-server/src/main/java/org/apache/zookeeper/server/quorum/FastLeaderElection.java
##########
@@ -976,26 +976,9 @@ public Vote lookForLeader() throws InterruptedException {
/*
* Exponential backoff
*/
- int tmpTimeOut = notTimeout * 2;
- notTimeout = Math.min(tmpTimeOut, maxNotificationInterval);
-
- /*
- * When a leader failure happens on a master, the backup will be supposed to receive the honour from
- * Oracle and become a leader, but the honour is likely to be delay. We do a re-check once timeout happens
- *
- * The leader election algorithm does not provide the ability of electing a leader from a single instance
- * which is in a configuration of 2 instances.
- * */
- self.getQuorumVerifier().revalidateVoteset(voteSet, notTimeout != minNotificationInterval);
- if (self.getQuorumVerifier() instanceof QuorumOracleMaj && voteSet != null && voteSet.hasAllQuorums() && notTimeout != minNotificationInterval) {
Review comment:
all right, i got it wrong, i will rollback it later
##########
File path: zookeeper-server/src/main/java/org/apache/zookeeper/server/quorum/FastLeaderElection.java
##########
@@ -976,26 +976,9 @@ public Vote lookForLeader() throws InterruptedException {
/*
* Exponential backoff
*/
- int tmpTimeOut = notTimeout * 2;
- notTimeout = Math.min(tmpTimeOut, maxNotificationInterval);
-
- /*
- * When a leader failure happens on a master, the backup will be supposed to receive the honour from
- * Oracle and become a leader, but the honour is likely to be delay. We do a re-check once timeout happens
- *
- * The leader election algorithm does not provide the ability of electing a leader from a single instance
- * which is in a configuration of 2 instances.
- * */
- self.getQuorumVerifier().revalidateVoteset(voteSet, notTimeout != minNotificationInterval);
- if (self.getQuorumVerifier() instanceof QuorumOracleMaj && voteSet != null && voteSet.hasAllQuorums() && notTimeout != minNotificationInterval) {
Review comment:
thanks for your reminder
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [zookeeper] zhongxiongzeng commented on pull request #1709: ZOOKEEPER-4312: remove unnecessary code
Posted by GitBox <gi...@apache.org>.
zhongxiongzeng commented on pull request #1709:
URL: https://github.com/apache/zookeeper/pull/1709#issuecomment-863714815
done , @maoling please take a look
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [zookeeper] maoling edited a comment on pull request #1709: ZOOKEEPER-4312: remove unnecessary code
Posted by GitBox <gi...@apache.org>.
maoling edited a comment on pull request #1709:
URL: https://github.com/apache/zookeeper/pull/1709#issuecomment-855961842
@chingchan1996 PTAL. What you want is the following ?
```
* The leader election algorithm does not provide the ability of electing a leader from a single instance
* which is in a configuration of 2 instances.
* */
if (self.getQuorumVerifier() instanceof QuorumOracleMaj
&& self.getQuorumVerifier().revalidateVoteset(voteSet, notTimeout != minNotificationInterval)) {
setPeerState(proposedLeader, voteSet);
```
- Cc @zhongxiongzeng
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org