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 16:47:01 UTC

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

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



##########
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:
       Yes it should always be INVALID_LOG_INDEX. I will remove that check.
   
   Segment endIndex is updated during readSegmentFile call. It in turn calls segment.append for each entry and updates the endIndex.




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