chirag-wadhwa5 commented on code in PR #16792:
URL: https://github.com/apache/kafka/pull/16792#discussion_r1710836151
##########
core/src/main/scala/kafka/server/KafkaApis.scala:
##########
@@ -4367,10 +4443,49 @@ class KafkaApis(val requestChannel: RequestChannel,
CompletableFuture.completedFuture[Unit](())
}
- private def getAcknowledgeBatchesFromShareFetchRequest(shareFetchRequest:
ShareFetchRequest,
- topicIdNames:
util.Map[Uuid, String],
- erroneous:
mutable.Map[TopicIdPartition, ShareAcknowledgeResponseData.PartitionData]
- ):
mutable.Map[TopicIdPartition, util.List[ShareAcknowledgementBatch]] = {
+ // Visible for Testing
+ def
getAcknowledgeBatchesFromShareAcknowledgeRequest(shareAcknowledgeRequest:
ShareAcknowledgeRequest,
+ topicIdNames:
util.Map[Uuid, String],
+ erroneous:
mutable.Map[TopicIdPartition, ShareAcknowledgeResponseData.PartitionData]
+ ):
mutable.Map[TopicIdPartition, util.List[ShareAcknowledgementBatch]] = {
+ val acknowledgeBatchesMap = mutable.Map[TopicIdPartition,
util.List[ShareAcknowledgementBatch]]()
+ shareAcknowledgeRequest.data().topics().forEach{ topic =>
+ if (!topicIdNames.containsKey(topic.topicId)) {
+ topic.partitions.forEach{ case partition:
ShareAcknowledgeRequestData.AcknowledgePartition =>
+ val topicIdPartition = new TopicIdPartition(
+ topic.topicId,
+ new TopicPartition(null, partition.partitionIndex))
+ erroneous +=
+ topicIdPartition ->
ShareAcknowledgeResponse.partitionResponse(topicIdPartition,
Errors.UNKNOWN_TOPIC_ID)
+ }
+ } else {
+ topic.partitions().forEach{ partition =>
+ if (partition.acknowledgementBatches().size() > 0) {
Review Comment:
Thanks for the review. That is the incorrect behaviour. I have made changes
in handleAcknowledgements method to take care of this, and removed the check
`if (partition.acknowledgementBatches().size() > 0)` altogether from
`getAcknowledgeBatchesFromShareAcknowledgeRequest` and
`getAcknowledgeBatchesFromShareFetchRequest`
--
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]