szetszwo commented on code in PR #1047:
URL: https://github.com/apache/ratis/pull/1047#discussion_r1515134904


##########
ratis-proto/src/main/proto/Raft.proto:
##########
@@ -175,6 +175,12 @@ message CommitInfoProto {
   uint64 commitIndex = 2;
 }
 
+message LogInfoProto {
+  TermIndexProto lastSnapshot = 1;
+  TermIndexProto applied = 2;
+  TermIndexProto committed = 3;

Review Comment:
   Please add also `TermIndexProto lastEntry` (which is the last entry written 
to the log). 



##########
ratis-server/src/main/java/org/apache/ratis/server/impl/RaftServerImpl.java:
##########
@@ -642,9 +643,24 @@ GroupInfoReply getGroupInfo(GroupInfoRequest request) {
     final RaftConfigurationProto conf =
         LogProtoUtils.toRaftConfigurationProtoBuilder(getRaftConf()).build();
     return new GroupInfoReply(request, getCommitInfos(), getGroup(), 
getRoleInfoProto(),
-        dir.isHealthy(), conf);
+        dir.isHealthy(), conf, getLogInfo());
   }
 
+  LogInfoProto getLogInfo(){
+    long currentTerm = getInfo().getCurrentTerm();
+    LogInfoProto.Builder logInfoBuilder = LogInfoProto.newBuilder();
+    logInfoBuilder.setApplied(TermIndex.valueOf(currentTerm, 
getInfo().getLastAppliedIndex()).toProto());
+    
logInfoBuilder.setCommitted(getRaftLog().getLastEntryTermIndex().toProto());

Review Comment:
   This is the last entry, not the committed entry.  We should use 
`RaftLog.getLastCommittedIndex()`.



-- 
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]

Reply via email to