[ 
https://issues.apache.org/jira/browse/RATIS-1282?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17260196#comment-17260196
 ] 

Tsz-wo Sze commented on RATIS-1282:
-----------------------------------

[~runzhiwang], currently, askForPreVotes and askForVotes handle the vote result 
differently:
# When TIMEOUT, askForVotes will retry but askForPreVotes will not.
# When DISCOVERED_A_NEW_TERM, askForVotes will 
changeToFollowerAndPersistMetadata but askForPreVotes will not.

If askForPreVotes has passed, askForVotes will pass with a high probability 
(e.g. it probably won't see TIMEOUT/DISCOVERED_A_NEW_TERM).  So askForPreVotes 
should do the same as askForVotes for these cases.  Otherwise, these case will 
be ignored.

> Refactor the code for preVote and vote
> --------------------------------------
>
>                 Key: RATIS-1282
>                 URL: https://issues.apache.org/jira/browse/RATIS-1282
>             Project: Ratis
>          Issue Type: Improvement
>          Components: server
>            Reporter: Tsz-wo Sze
>            Assignee: Tsz-wo Sze
>            Priority: Major
>
> This is a followup work of RATIS-993 to reduce the code duplication between 
> preVote and vote.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to