You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jira@kafka.apache.org by GitBox <gi...@apache.org> on 2021/10/12 14:16:30 UTC

[GitHub] [kafka] jsancio commented on a change in pull request #11386: MINOR: Fix highest offset when loading KRaft metadata snapshots

jsancio commented on a change in pull request #11386:
URL: https://github.com/apache/kafka/pull/11386#discussion_r727178831



##########
File path: metadata/src/main/java/org/apache/kafka/image/MetadataDelta.java
##########
@@ -46,6 +47,10 @@
 public final class MetadataDelta {
     private final MetadataImage image;
 
+    private long highestOffset;

Review comment:
       I decided to use `OffsetAndEpoch` in `MetadataImage` because `MetadataImage` in immutable.
   
   `MetadataDelta`, `highestOffset` and `highestEpoch` gets updated every time `replay` gets called. I thought it would apply less GC pressure if we just update the fields instead of creating a new `OffsetAndEpoch` object.




-- 
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: jira-unsubscribe@kafka.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org