OneSizeFitsQuorum commented on code in PR #924:
URL: https://github.com/apache/ratis/pull/924#discussion_r1332783555
##########
ratis-server/src/main/java/org/apache/ratis/server/raftlog/segmented/SegmentedRaftLog.java:
##########
@@ -382,26 +385,29 @@ protected CompletableFuture<Long>
appendEntryImpl(LogEntryProto entry) {
final Timekeeper.Context appendEntryTimerContext =
getRaftLogMetrics().startAppendEntryTimer();
validateLogEntry(entry);
final LogSegment currentOpenSegment = cache.getOpenSegment();
+ boolean rollOpenSegment = false;
Review Comment:
Looking at the contents of shouldEvict, it seems that a check is not
necessary because nothing will change.
```Java
final CacheInfo closedSegmentsCacheInfo = closedSegments.getCacheInfo();
if (closedSegmentsCacheInfo.getCount() > maxCachedSegments) {
return true;
}
final long size = closedSegmentsCacheInfo.getSize()
+
Optional.ofNullable(openSegment).map(LogSegment::getTotalCacheSize).orElse(0L);
return size > maxSegmentCacheSize;
}
```
--
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]