johnnychhsu commented on code in PR #15476:
URL: https://github.com/apache/kafka/pull/15476#discussion_r1521314724
##########
storage/src/main/java/org/apache/kafka/storage/internals/log/LogValidator.java:
##########
@@ -293,11 +293,11 @@ public ValidationResult
assignOffsetsNonCompressed(LongRef offsetCounter,
if (timestampType == TimestampType.LOG_APPEND_TIME) {
maxTimestamp = now;
- offsetOfMaxTimestamp = initialOffset;
- }
-
- if (toMagic >= RecordBatch.MAGIC_VALUE_V2) {
- offsetOfMaxTimestamp = offsetCounter.value - 1;
+ if (toMagic >= RecordBatch.MAGIC_VALUE_V2) {
+ offsetOfMaxTimestamp = offsetCounter.value - 1;
Review Comment:
thanks for the comment!
this is the same behaviour before the previous change affected the results.
It differentiated the behaviour based on the magic value. I think the reason is
because
> /**
> A record batch is a container for records. In old versions of the record
format (versions 0 and 1),
> a batch consisted always of a single record if no compression was enabled,
but could contain
> many records otherwise. Newer versions (magic versions 2 and above) will
generally contain many records
> regardless of compression.
>*/
> public interface RecordBatch extends Iterable<Record>
So version before magic_value=2 doesn't matter.
--
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]