You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ratis.apache.org by "Mukul Kumar Singh (JIRA)" <ji...@apache.org> on 2018/01/04 12:29:00 UTC
[jira] [Created] (RATIS-183) Parallelize log sync in Follower
Mukul Kumar Singh created RATIS-183:
---------------------------------------
Summary: Parallelize log sync in Follower
Key: RATIS-183
URL: https://issues.apache.org/jira/browse/RATIS-183
Project: Ratis
Issue Type: Bug
Reporter: Mukul Kumar Singh
Assignee: Mukul Kumar Singh
Currently the followers in a Ratis ring append entries synchronously. This happens because of the following code. server.appendEntries(request) should be changed to returned a future so solve this issue.
{code}
@Override
public StreamObserver<AppendEntriesRequestProto> appendEntries(
StreamObserver<AppendEntriesReplyProto> responseObserver) {
return new StreamObserver<AppendEntriesRequestProto>() {
@Override
public void onNext(AppendEntriesRequestProto request) {
try {
final AppendEntriesReplyProto reply = server.appendEntries(request);
responseObserver.onNext(reply);
} catch (Throwable e) {
if (LOG.isDebugEnabled()) {
LOG.debug("{} got exception when appendEntries {}: {}",
getId(), ProtoUtils.toString(request.getServerRequest()), e);
}
responseObserver.onError(RaftGrpcUtil.wrapException(e));
}
}
@Override
public void onError(Throwable t) {
// for now we just log a msg
LOG.info("{}: appendEntries on error. Exception: {}", getId(), t);
}
@Override
public void onCompleted() {
LOG.info("{}: appendEntries completed", getId());
responseObserver.onCompleted();
}
};
}
{code}
--
This message was sent by Atlassian JIRA
(v6.4.14#64029)