You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jira@kafka.apache.org by "ijuma (via GitHub)" <gi...@apache.org> on 2025/03/30 19:06:18 UTC
[PR] MINOR: Remove dead code `maybeWarnIfOversizedRecords` [kafka]
ijuma opened a new pull request, #19316:
URL: https://github.com/apache/kafka/pull/19316
The `metadataVersionSupplier` is unused after this - remove it.
--
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
Re: [PR] MINOR: Remove dead code `maybeWarnIfOversizedRecords` [kafka]
Posted by "chia7712 (via GitHub)" <gi...@apache.org>.
chia7712 commented on code in PR #19316:
URL: https://github.com/apache/kafka/pull/19316#discussion_r2022845482
##########
core/src/main/scala/kafka/server/RemoteLeaderEndPoint.scala:
##########
@@ -203,7 +203,7 @@ class RemoteLeaderEndPoint(logPrefix: String,
None
} else {
val metadataVersion = metadataVersionSupplier()
- val version: Short = if (metadataVersion.fetchRequestVersion >= 13 && !fetchData.canUseTopicIds) {
+ val version: Short = if (!fetchData.canUseTopicIds) {
Review Comment:
You are right. file https://issues.apache.org/jira/browse/KAFKA-19065
--
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
Re: [PR] MINOR: Remove dead code `maybeWarnIfOversizedRecords` [kafka]
Posted by "ijuma (via GitHub)" <gi...@apache.org>.
ijuma commented on code in PR #19316:
URL: https://github.com/apache/kafka/pull/19316#discussion_r2021657292
##########
core/src/main/scala/kafka/server/ReplicaFetcherThread.scala:
##########
@@ -161,15 +157,6 @@ class ReplicaFetcherThread(name: String,
}
}
- private def maybeWarnIfOversizedRecords(records: MemoryRecords, topicPartition: TopicPartition): Unit = {
- // oversized messages don't cause replication to fail from fetch request version 3 (KIP-74)
- if (metadataVersionSupplier().fetchRequestVersion <= 2 && records.sizeInBytes > 0 && records.validBytes <= 0)
Review Comment:
I think you're saying that IBP 3.3 implies fetch request 13 or higher. That makes sense, I pushed a commit that removes that check.
--
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
Re: [PR] MINOR: Remove dead code `maybeWarnIfOversizedRecords` [kafka]
Posted by "chia7712 (via GitHub)" <gi...@apache.org>.
chia7712 commented on code in PR #19316:
URL: https://github.com/apache/kafka/pull/19316#discussion_r2022446672
##########
core/src/main/scala/kafka/server/RemoteLeaderEndPoint.scala:
##########
@@ -203,7 +203,7 @@ class RemoteLeaderEndPoint(logPrefix: String,
None
} else {
val metadataVersion = metadataVersionSupplier()
- val version: Short = if (metadataVersion.fetchRequestVersion >= 13 && !fetchData.canUseTopicIds) {
+ val version: Short = if (!fetchData.canUseTopicIds) {
Review Comment:
This is interesting. IIRC, the topic id of fetch is introduced in 3.1, so `canUseTopicIds` should be always enabled after we bump the baseline of MV to 3.3.
--
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
Re: [PR] MINOR: Remove dead code `maybeWarnIfOversizedRecords` [kafka]
Posted by "ijuma (via GitHub)" <gi...@apache.org>.
ijuma commented on code in PR #19316:
URL: https://github.com/apache/kafka/pull/19316#discussion_r2021661151
##########
core/src/main/scala/kafka/server/ReplicaFetcherThread.scala:
##########
@@ -161,15 +157,6 @@ class ReplicaFetcherThread(name: String,
}
}
- private def maybeWarnIfOversizedRecords(records: MemoryRecords, topicPartition: TopicPartition): Unit = {
- // oversized messages don't cause replication to fail from fetch request version 3 (KIP-74)
- if (metadataVersionSupplier().fetchRequestVersion <= 2 && records.sizeInBytes > 0 && records.validBytes <= 0)
Review Comment:
I also updated the PR description.
--
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
Re: [PR] MINOR: Remove dead code `maybeWarnIfOversizedRecords` [kafka]
Posted by "ijuma (via GitHub)" <gi...@apache.org>.
ijuma commented on code in PR #19316:
URL: https://github.com/apache/kafka/pull/19316#discussion_r2022835628
##########
core/src/main/scala/kafka/server/RemoteLeaderEndPoint.scala:
##########
@@ -203,7 +203,7 @@ class RemoteLeaderEndPoint(logPrefix: String,
None
} else {
val metadataVersion = metadataVersionSupplier()
- val version: Short = if (metadataVersion.fetchRequestVersion >= 13 && !fetchData.canUseTopicIds) {
+ val version: Short = if (!fetchData.canUseTopicIds) {
Review Comment:
Yes, I looked into that, but it's a larger change since some of the code is shared and topic ids are optional in the shared code. I think we can file a JIRA ticket to make this change via a separate PR.
--
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
Re: [PR] MINOR: Remove dead code `maybeWarnIfOversizedRecords` [kafka]
Posted by "ijuma (via GitHub)" <gi...@apache.org>.
ijuma merged PR #19316:
URL: https://github.com/apache/kafka/pull/19316
--
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
Re: [PR] MINOR: Remove dead code `maybeWarnIfOversizedRecords` [kafka]
Posted by "ijuma (via GitHub)" <gi...@apache.org>.
ijuma commented on code in PR #19316:
URL: https://github.com/apache/kafka/pull/19316#discussion_r2022835628
##########
core/src/main/scala/kafka/server/RemoteLeaderEndPoint.scala:
##########
@@ -203,7 +203,7 @@ class RemoteLeaderEndPoint(logPrefix: String,
None
} else {
val metadataVersion = metadataVersionSupplier()
- val version: Short = if (metadataVersion.fetchRequestVersion >= 13 && !fetchData.canUseTopicIds) {
+ val version: Short = if (!fetchData.canUseTopicIds) {
Review Comment:
Yes, I looked into that after your original comment, but it's a larger change since some of the code is shared and topic ids are optional in the shared code. I think we can file a JIRA ticket to make this change via a separate PR.
--
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
Re: [PR] MINOR: Remove dead code `maybeWarnIfOversizedRecords` [kafka]
Posted by "ijuma (via GitHub)" <gi...@apache.org>.
ijuma commented on code in PR #19316:
URL: https://github.com/apache/kafka/pull/19316#discussion_r2022845619
##########
core/src/main/scala/kafka/server/RemoteLeaderEndPoint.scala:
##########
@@ -203,7 +203,7 @@ class RemoteLeaderEndPoint(logPrefix: String,
None
} else {
val metadataVersion = metadataVersionSupplier()
- val version: Short = if (metadataVersion.fetchRequestVersion >= 13 && !fetchData.canUseTopicIds) {
+ val version: Short = if (!fetchData.canUseTopicIds) {
Review Comment:
As part of that ticket, we should also remove the `getOrElse` below and change `PartitionFetchState.topicId` not to be Optional, etc.
> fetchState.topicId.getOrElse(Uuid.ZERO_UUID),
--
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
Re: [PR] MINOR: Remove dead code `maybeWarnIfOversizedRecords` [kafka]
Posted by "chia7712 (via GitHub)" <gi...@apache.org>.
chia7712 commented on code in PR #19316:
URL: https://github.com/apache/kafka/pull/19316#discussion_r2021391071
##########
core/src/main/scala/kafka/server/ReplicaFetcherThread.scala:
##########
@@ -161,15 +157,6 @@ class ReplicaFetcherThread(name: String,
}
}
- private def maybeWarnIfOversizedRecords(records: MemoryRecords, topicPartition: TopicPartition): Unit = {
- // oversized messages don't cause replication to fail from fetch request version 3 (KIP-74)
- if (metadataVersionSupplier().fetchRequestVersion <= 2 && records.sizeInBytes > 0 && records.validBytes <= 0)
Review Comment:
It seems another use case of `fetchRequestVersion` is dead code. Maybe we can remove it as well?
```scala
val version: Short = if (metadataVersion.fetchRequestVersion >= 13 && !fetchData.canUseTopicIds) {
12
} else {
metadataVersion.fetchRequestVersion
}
```
https://github.com/apache/kafka/blob/5982943267ecbc53c42e80feb2d8506aad0c0559/core/src/main/scala/kafka/server/RemoteLeaderEndPoint.scala#L206
--
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