[
https://issues.apache.org/jira/browse/RATIS-1247?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17253352#comment-17253352
]
runzhiwang commented on RATIS-1247:
-----------------------------------
[~szetszwo] Hi, if we add a new TRANSFERRING_LEADERSHIP role, maybe change a
lot, because there are too many isLeader() check, for example the following code
{code:java}
private void yieldLeaderToHigherPriorityPeer() {
if (!server.getInfo().isLeader()) {
return;
}
...
}
{code}
maybe change to
{code:java}
private void yieldLeaderToHigherPriorityPeer() {
if (!server.getInfo().isLeader() &&
!server.getInfo().isTransferingLeader()) {
return;
}
...
}
{code}
or change as follows, because we need to expose isLeader() to user, maybe it's
necessary if user check isLeader() then read.
{
code:java}
boolean isLeader() {
return getCurrentRole() == RaftPeerRole.LEADER || getCurrentRole() ==
RaftPeerRole.TRANSFERING_LEADER;
}
{code}
Both above seems complicated, because when transferLeaderShip we only stop
accept write request. Maybe we only need to add a flag to indicate current is
in transferLeaderShip. What do you think ?
> Support rolling upgrade and rollback
> ------------------------------------
>
> Key: RATIS-1247
> URL: https://issues.apache.org/jira/browse/RATIS-1247
> Project: Ratis
> Issue Type: New Feature
> Reporter: runzhiwang
> Assignee: runzhiwang
> Priority: Major
>
--
This message was sent by Atlassian Jira
(v8.3.4#803005)