Closed ghost closed 10 years ago
The leader sends duplicate COMMIT messages because of the newly joined followers.
Image there are two servers form a quorum, they have last acked zxid like :
S1 : <0,5>
S2: <0, 5>
Then I sent the COMMIT(0, 5) to the two. Then a new follower joins and ACK(0,3) :
S1 : <0,5>
S2: <0, 5>
S3: <0, 3>
We still decide the COMMIT is (0, 5) but because we've already sent the COMMIT(0,5) we won't send it anymore. In this case the new joined follower never get the chance to deliver the committed transactions.
Another solution is that we keep the last committed zxid for each follower. Yeah, that would be a way to solve this.
Currently AckProcessor sends out a commit message after each ack, even if the acknowledged transaction has already been committed. Instead, it should keep track of the last committed zxid and ignore ack if the acknowledged zxid is smaller than or equal to the last committed zxid.
=== edit: typo