[
https://issues.apache.org/jira/browse/RATIS-2109?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17852315#comment-17852315
]
Tsz-wo Sze commented on RATIS-2109:
-----------------------------------
[~ivanandika], That is a good point! The code should return the result from
updateIncreasingly(..).
> RaftLogBase#updateCommitIndex should return true only if commitIndex is
> increased
> ---------------------------------------------------------------------------------
>
> Key: RATIS-2109
> URL: https://issues.apache.org/jira/browse/RATIS-2109
> Project: Ratis
> Issue Type: Improvement
> Reporter: Ivan Andika
> Assignee: Ivan Andika
> Priority: Minor
>
> RaftLogBase#updateCommitIndex returns true regardless whether commit index is
> actually increased (RaftLogIndex#updateIncreasingly returns true). This can
> cause unnecessary StateMachineUpdater notification
> We can change it so that RaftLogBase#updateCommitIndex only returns true if
> commit index is actually increased.
> Note: For leader ServerState#updateCommitIndex is called only if there are
> entries to commit (i.e. majority > oldLasCommitted), so
> RaftLogBase#updateCommitIndex should increase the commit index of leader.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)