Description
In LeaderStateImpl, the placeHolderIndex is set to nextIndex in the constructor. However, the placeHolder log is created in start() method using nextIndex again. Both the constructor and the start() method are called in RaftServerImpl.changeToLeader() which is synchronized. So, the nextIndex won't change in-between.
As an improvement, it is better to get nextIndex once.
Attachments
Issue Links
- links to