chia7712 commented on code in PR #16873:
URL: https://github.com/apache/kafka/pull/16873#discussion_r1722135957
##########
core/src/main/scala/kafka/server/KafkaApis.scala:
##########
@@ -1170,6 +1174,8 @@ class KafkaApis(val requestChannel: RequestChannel,
debug(s"OffsetRequest with correlation id $correlationId from client
$clientId on partition $topicPartition " +
s"failed because the partition is duplicated in the request.")
buildErrorResponse(Errors.INVALID_REQUEST, partition)
+ } else if
(timestampMinSupportedVersion.contains(partition.timestamp()) && version <
timestampMinSupportedVersion(partition.timestamp())) {
Review Comment:
> IIRC, for negative timestamp, we don't support it in Kafka. I found
[KIP-228](https://cwiki.apache.org/confluence/display/KAFKA/KIP-228%2BNegative%2Brecord%2Btimestamp%2Bsupport)
about it, but it looks like it's still under discussion. IMHO, if a behavior
is unexpected, we may need to add some limitations to it in a newer version, so
we can minimize unexpected result.
thanks for that sharing. That means we do NOT care the cases of using
negative ts in record. Hence, we can add explicit behavior for each version,
and "reject" the requests which using "unknown" negative ts. for example:
```scala
else if (partition.timestamp() < 0 &&
!timestampMinSupportedVersion.contains(partition.timestamp())) {
buildErrorResponse(Errors.UNSUPPORTED_VERSION, partition)
}
```
@FrankYang0529 WDYT?
--
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]