junrao commented on code in PR #15474:
URL: https://github.com/apache/kafka/pull/15474#discussion_r1518419803
##########
storage/src/main/java/org/apache/kafka/storage/internals/log/LogValidator.java:
##########
@@ -417,8 +422,14 @@ public ValidationResult
validateMessagesAndAssignOffsetsCompressed(LongRef offse
long lastOffset = offsetCounter.value - 1;
firstBatch.setLastOffset(lastOffset);
- if (timestampType == TimestampType.LOG_APPEND_TIME)
+ if (timestampType == TimestampType.LOG_APPEND_TIME) {
maxTimestamp = now;
+ if (toMagic >= RecordBatch.MAGIC_VALUE_V2) {
+ offsetOfMaxTimestamp = lastOffset;
Review Comment:
Hmm, we should be consistent among different magic values, right? It seems
the semantic for MAX_TIMESTAMP is the first offset with the max timestamp.
--
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]