[Bugfix] Fix slow recovery when server down because valid follower servers #427
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.
Summary
When leader server goes down, the follower servers will instantly be selected out a new leader, and the client need to sense the change and refresh to get the new leader. To avoid access the old leader before the new leader standing out, the client will invalid the connection to the old server after sensing it down already. The old server will maintain in the follower list after the new leader standing out and cannot be valid, because some unrefreshed tablets would access to the ole leader. After about 10 seconds, the old leader would be removed from the follower list.
Solution Description