[
https://issues.apache.org/jira/browse/ZOOKEEPER-1324?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13647330#comment-13647330
]
Germán Blanco commented on ZOOKEEPER-1324:
------------------------------------------
Hello all,
I hope I don't bother you too much with this comment, given that I don't
actually understand most of the code in the current proposed patch.
It seems to me that this is a problem in 3.4 and it should be corrected with as
few changes as possible. Other improvements should go to 3.5. And it seems to
me that the problem is that NEWLEADER gets both inserted in the
outstandingProposals and sent to the follower directly. So apparently, this
could be solved with the very small change bellow. It just skips the inserting
of NEWLEADER in the outstanding proposals and keeps all the current processing.
Line numbers might not be exact, since it was done for trunk a few weeks ago.
I could propose it on top of the current patch, but it would mean removing all
of it (except where it changes the test case), without really understanding
what it is doing, and adding these few lines.
Could anybody, maybe Flavio, please explain where I get this problem wrong?
Best regards,
Germán Blanco.
--- src/java/main/org/apache/zookeeper/server/quorum/Leader.java
(revision 1470391)
+++ src/java/main/org/apache/zookeeper/server/quorum/Leader.java
(working copy)
@@ -1116,10 +1116,11 @@
List<Long>zxids = new
ArrayList<Long>(outstandingProposals.keySet());
Collections.sort(zxids);
for (Long zxid: zxids) {
- if (zxid <= lastSeenZxid) {
+ QuorumPacket qp = outstandingProposals.get(zxid).packet;
+ if ((zxid <= lastSeenZxid) || (qp.getType() ==
Leader.NEWLEADER)) {
continue;
}
- handler.queuePacket(outstandingProposals.get(zxid).packet);
+ handler.queuePacket(qp);
}
}
if (handler.getLearnerType() == LearnerType.PARTICIPANT) {
> Remove Duplicate NEWLEADER packets from the Leader to the Follower.
> -------------------------------------------------------------------
>
> Key: ZOOKEEPER-1324
> URL: https://issues.apache.org/jira/browse/ZOOKEEPER-1324
> Project: ZooKeeper
> Issue Type: Improvement
> Components: quorum
> Affects Versions: 3.5.0
> Reporter: Mahadev konar
> Assignee: Thawan Kooburat
> Priority: Critical
> Fix For: 3.5.0, 3.4.6
>
> Attachments: ZOOKEEPER-1324-branch-3.4.patch, ZOOKEEPER-1324.patch,
> ZOOKEEPER-1324.patch, ZOOKEEPER-1324.patch, ZOOKEEPER-1324.patch,
> ZOOKEEPER-1324.patch, ZOOKEEPER-1324.patch
>
>
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira