You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ratis.apache.org by GitBox <gi...@apache.org> on 2020/05/15 14:09:54 UTC

[GitHub] [incubator-ratis] mukul1987 commented on a change in pull request #100: RATIS-937. Loading of open segments always throws corrupted segment warning

mukul1987 commented on a change in pull request #100:
URL: https://github.com/apache/incubator-ratis/pull/100#discussion_r425827891



##########
File path: ratis-server/src/main/java/org/apache/ratis/server/raftlog/segmented/LogSegment.java
##########
@@ -145,6 +147,10 @@ static LogSegment loadSegment(RaftStorage storage, File file, long start, long e
     });
     LOG.info("Successfully read {} entries from segment file {}", entryCount, file);
 
+    if (isOpen && end == INVALID_LOG_INDEX) {

Review comment:
       Also how is the segment's end index initialized after a node restart ?

##########
File path: ratis-server/src/main/java/org/apache/ratis/server/raftlog/segmented/LogSegment.java
##########
@@ -145,6 +147,10 @@ static LogSegment loadSegment(RaftStorage storage, File file, long start, long e
     });
     LOG.info("Successfully read {} entries from segment file {}", entryCount, file);
 
+    if (isOpen && end == INVALID_LOG_INDEX) {

Review comment:
       If the segment is open, the end should always be INVALID_LOG_INDEX?
   Are there cases where it is not INVALID_LOG_INDEX ?




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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org