jsancio commented on PR #15825: URL: https://github.com/apache/kafka/pull/15825#issuecomment-2105087021
@kamalcph, looks like a bug to me. The predicate should be `if (!hwm.messageOffsetOnly)` or the if/else blocks should be swapped. I suspect that we haven't noticed this bug in the KRaft implementation (`KafkaRaftClient`) because kraft never looks at the segment and byte position for the HWM. If you are going to fix this code, do you mind adding a test for this case? Since `KafkaMetadataLog` calls `UnifiedLog.fetchOffsetSnapshot`, `hwm.messageOffsetOnly` should always be false. -- 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-unsubscr...@kafka.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org