junrao commented on a change in pull request #7929: URL: https://github.com/apache/kafka/pull/7929#discussion_r502023899
########## File path: core/src/test/scala/unit/kafka/log/LogTest.scala ########## @@ -782,7 +782,7 @@ class LogTest { } // Retain snapshots for the last 2 segments - ProducerStateManager.deleteSnapshotsBefore(logDir, segmentOffsets(segmentOffsets.size - 2)) + ProducerStateManager.listSnapshotFiles(logDir).filter(_.offset < segmentOffsets(segmentOffsets.size - 2)).foreach(_.deleteIfExists()) Review comment: Since deleteSnapshotsBefore() still exist, could we keep using it? ########## File path: core/src/test/scala/unit/kafka/log/LogTest.scala ########## @@ -794,16 +794,12 @@ class LogTest { // Only delete snapshots before the base offset of the recovery point segment (post KAFKA-5829 behaviour) to // avoid reading all segments - ProducerStateManager.deleteSnapshotsBefore(logDir, offsetForRecoveryPointSegment) + ProducerStateManager.listSnapshotFiles(logDir).filter(_.offset < offsetForRecoveryPointSegment).foreach(_.deleteIfExists()) Review comment: Since deleteSnapshotsBefore() still exist, could we keep using it? ---------------------------------------------------------------- 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: us...@infra.apache.org