OneSizeFitsQuorum commented on code in PR #1170:
URL: https://github.com/apache/ratis/pull/1170#discussion_r1816000107


##########
ratis-server/src/main/java/org/apache/ratis/server/raftlog/segmented/SegmentedRaftLog.java:
##########
@@ -405,12 +405,13 @@ protected CompletableFuture<Long> purgeImpl(long index) {
     try (AutoCloseableLock writeLock = writeLock()) {
       SegmentedRaftLogCache.TruncationSegments ts = cache.purge(index);
       updateSnapshotIndexFromStateMachine();
-      LOG.debug("purging segments:{}", ts);
       if (ts != null) {
+        LOG.info("{}: {}", getName(), ts);
         Task task = fileLogWorker.purge(ts);
         return task.getFuture();
       }
     }
+    LOG.info("{}: purge({}) found nothing to purge.", getName(), index);

Review Comment:
   It seems this line will cause a lot of info log? If we don't actually delete 
the file here, maybe we don't need to log here



##########
ratis-server/src/main/java/org/apache/ratis/server/raftlog/segmented/SegmentedRaftLogCache.java:
##########
@@ -154,7 +159,8 @@ long maxEndIndex() {
 
     @Override
     public String toString() {
-      return "toTruncate: " + toTruncate
+      return reason
+          + "\ntoTruncate: " + toTruncate

Review Comment:
   \n toTruncate:



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