lokeshj1703 commented on a change in pull request #217:
URL: https://github.com/apache/incubator-ratis/pull/217#discussion_r504466346
##########
File path:
ratis-server/src/main/java/org/apache/ratis/server/raftlog/segmented/SegmentedRaftLog.java
##########
@@ -493,10 +493,21 @@ public void syncWithSnapshot(long lastSnapshotIndex) {
// Close open log segment if entries are already included in snapshot
LogSegment openSegment = cache.getOpenSegment();
- if (openSegment != null && openSegment.getEndIndex() <= lastSnapshotIndex)
{
- fileLogWorker.closeLogSegment(openSegment);
+ long purgeIndex = lastSnapshotIndex;
+ if (openSegment != null && openSegment.hasEntries()) {
+ LOG.debug("Found open segment {}, with end index {}, snapshotIndex {}",
Review comment:
Can we add function name in the log message?
----------------------------------------------------------------
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:
[email protected]