discarded messages seems will exists in some follower, when the leader
failed. considering the following corner case:

the latest committed proposals in the New Leader. the following is the
latest zxid list with  format: *<epoch>,<lower bits>*
 1,7
 1,8
 2,0
 2,1

the last zxid in a follower
1,7
1,8
1,9

when the follower sync with the new leader, the transaction *1,9 *should be
truncated, but I couldn't found the code that can handle this case.
In this case the following code in LeanerHandler seems will be executed.

   if (proposals.size() != 0) {
                    if ((leader.zk.getZKDatabase().getmaxCommittedLog() >=
peerLastZxid)
                            &&
(leader.zk.getZKDatabase().getminCommittedLog() <= peerLastZxid)) {
                        packetToSend = Leader.DIFF;

Sincerely

Reply via email to