-
Notifications
You must be signed in to change notification settings - Fork 75
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
[Curp] Fix concurrent bug #86
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
markcty
force-pushed
the
fix-concurrent-bug
branch
from
November 23, 2022 08:54
de54f88
to
ffec16b
Compare
rogercloud
reviewed
Nov 23, 2022
Please add a test to coverage the error. |
markcty
force-pushed
the
fix-concurrent-bug
branch
3 times, most recently
from
November 25, 2022 05:30
7d8d127
to
70c5d97
Compare
markcty
force-pushed
the
fix-concurrent-bug
branch
from
November 25, 2022 06:38
70c5d97
to
52799e7
Compare
rogercloud
reviewed
Nov 28, 2022
rogercloud
reviewed
Nov 28, 2022
rogercloud
reviewed
Nov 28, 2022
rogercloud
reviewed
Nov 28, 2022
rogercloud
reviewed
Nov 28, 2022
rogercloud
reviewed
Nov 28, 2022
markcty
force-pushed
the
fix-concurrent-bug
branch
from
November 28, 2022 06:19
52799e7
to
da2e01f
Compare
The bug will happen in the following situation: 1. A client proposes a command to all servers. 2. The leader receives the command, sync to others, and committed the command. 3. A follower it notices that the command is committed and executes it. When the execution is over, it will need to remove the command from spec pool. However, since the follower may have not yet received the proposal from the client, it will find no such command in the spec pool and panic. Suggested fix: When a follower tries to remove a non-exist command from spec pool, it will register the command id in an internal buffer(ready). When the proposal is finally received, it will directly remove the command. The ready pool needs gc periodically since the proposal may never arrive.
markcty
force-pushed
the
fix-concurrent-bug
branch
from
November 28, 2022 07:48
da2e01f
to
b4903e1
Compare
rogercloud
approved these changes
Nov 28, 2022
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The bug will happen in the following situation:
Suggested fix:
When a follower tries to remove a non-exist command from spec pool, it will register the command id in an internal buffer. When the proposal is finally received, it will directly remove the command. (The ready pool needs to gc after some time)