imbajin commented on code in PR #2203:
URL:
https://github.com/apache/incubator-hugegraph/pull/2203#discussion_r1211077262
##########
hugegraph-core/src/main/java/org/apache/hugegraph/backend/store/raft/rpc/RpcForwarder.java:
##########
@@ -77,7 +77,14 @@ public void forwardToLeader(PeerId leaderId, StoreCommand
command,
public void setResponse(StoreCommandResponse response) {
if (response.getStatus()) {
LOG.debug("StoreCommandResponse status ok");
- future.complete(Status.OK(), () -> null);
+ // This code forwards the request to the Raft leader and
considers the operation successful
+ // if it's forwarded successfully. It returns a
RaftClosure because the calling
+ // logic expects a RaftClosure result. Specifically, if
the current instance is the Raft leader,
+ // it executes the corresponding logic locally and
notifies the calling logic asynchronously
+ // via RaftClosure. Therefore, the result is returned as a
RaftClosure here.
Review Comment:
maybe better to use `/* */` next time
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]