[
https://issues.apache.org/jira/browse/RATIS-1247?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17253170#comment-17253170
]
runzhiwang commented on RATIS-1247:
-----------------------------------
[~amaliujia] Thanks for reminding, but we can not use pause, because #2 only
need to stop accept client write request, any other operation is normal,
especially for append entry. But pause stop append entry. The following code
shows append entry only work in RUNNING state for leader.
{code:java}
public void run() throws IOException {
boolean installSnapshotRequired;
for(; isRunning(); mayWait()) {
installSnapshotRequired = false;
//HB period is expired OR we have messages OR follower is behind with
commit index
if (shouldSendAppendEntries() || isFollowerCommitBehindLastCommitIndex())
{
if (installSnapshotEnabled) {
SnapshotInfo snapshot = shouldInstallSnapshot();
if (snapshot != null) {
installSnapshot(snapshot);
installSnapshotRequired = true;
}
} else {
TermIndex installSnapshotNotificationTermIndex =
shouldNotifyToInstallSnapshot();
if (installSnapshotNotificationTermIndex != null) {
installSnapshot(installSnapshotNotificationTermIndex);
installSnapshotRequired = true;
}
}
appendLog(installSnapshotRequired || haveTooManyPendingRequests());
}
getLeaderState().checkHealth(getFollower());
}
Optional.ofNullable(appendLogRequestObserver).ifPresent(StreamObserver::onCompleted);
}
{code}
> 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)