change progress status to replicate when handling heartbeat response #560
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.
In the current implementation, if there is a lagging follower node, the corresponding progress state in the Leader node is Probe. This state will not be released in handle_append_response until next new write.
However, there is a situation where when there is an unreachable node and the upper-level application calls report_unreachable, this node will be marked as Probe by the Leader. When this node rejoins the cluster, it is still in Probe state. If the cluster does not have any new writes during this period, this node is actually Replicate. But its Probe state will not be updated until next new write.
This has no effect on consistency, but some operations based on the progress state of the node may be involved in some upper-level applications. Therefore, it is believed that an operation can be added in handle_heartbeat_response to set the progress of the node that keeps up with the progress to replicate state.