dengziming commented on a change in pull request #10021:
URL: https://github.com/apache/kafka/pull/10021#discussion_r575934699



##########
File path: core/src/main/scala/kafka/raft/KafkaMetadataLog.scala
##########
@@ -315,7 +324,8 @@ object KafkaMetadataLog {
       }
       .forEach { path =>
         path.ifPresent { snapshotPath =>
-          if (snapshotPath.partial) {
+          if (snapshotPath.partial || snapshotPath.snapshotId.offset < 
log.logStartOffset) {

Review comment:
       Here I am thinking of uncleaned broker shutdown, the case you describe 
is one of them.

##########
File path: raft/src/main/java/org/apache/kafka/raft/ReplicatedLog.java
##########
@@ -261,7 +258,7 @@ default long truncateToEndOffset(OffsetAndEpoch endOffset) {
      * @return an Optional snapshot id at the log start offset if nonzero, 
otherwise returns an empty
      *         Optional
      */
-    Optional<OffsetAndEpoch> oldestSnapshotId();
+    Optional<OffsetAndEpoch> earliestSnapshotId();

Review comment:
       I didn't notice `ProducerStateManager`, I choose `earliest` because of 
the consumer offset reset strategy, now I think both are OK.




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


Reply via email to