-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Seems that readIndex() may return inconsistent value (e.g. 0) after node restart, is this a known issue? #1049
Comments
I think it's impossible, the
And when a node becomes a leader, it will update the
|
Hmm, seems that |
If so, that would be possible, good catch! But I really doubt if is this a common case(just one node) for the production usage of jraft. We can fix it, but maybe it is not urgent. |
Well, that'll be nice)) BTW, seems that it's not the difficult to fix it. In case of single noded cluster (and only single noded cluster). We may consider
What do you think? |
It seems like the fix will work as expected. Would you be able to create a pull request for this change? |
Sure |
Within node restart
lastCommittedIndex
initialized as 0Taking into the consideration that local log application triggered by
NodeImpl#init
is asynchronous, it's possible to handle readIndex request before local log re-play is finished and thus see inconsistent readIndex value. In other words, seems that there's a race between readIndex evaluation and lastCommittedIndex restoration on node restart.The text was updated successfully, but these errors were encountered: