Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RATIS-2109. RaftLogBase#updateCommitIndex should return true only if commitIndex is increased #1109

Merged
merged 1 commit into from
Jun 5, 2024

Conversation

ivandika3
Copy link
Contributor

What changes were proposed in this pull request?

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.

What is the link to the Apache JIRA

https://issues.apache.org/jira/browse/RATIS-2109

How was this patch tested?

Existing tests.

@ivandika3 ivandika3 marked this pull request as ready for review June 5, 2024 09:15
Copy link
Contributor

@szetszwo szetszwo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1 the change looks good.

@szetszwo szetszwo merged commit dac27e4 into apache:master Jun 5, 2024
12 checks passed
SzyWilliam pushed a commit that referenced this pull request Jun 12, 2024
szetszwo pushed a commit to szetszwo/ratis that referenced this pull request Jun 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants