jolshan commented on code in PR #14774: URL: https://github.com/apache/kafka/pull/14774#discussion_r1423323788
########## core/src/main/scala/kafka/coordinator/group/GroupCoordinator.scala: ########## @@ -909,8 +911,35 @@ private[group] class GroupCoordinator( val group = groupManager.getGroup(groupId).getOrElse { groupManager.addGroup(new GroupMetadata(groupId, Empty, time)) } - doTxnCommitOffsets(group, transactionalId, memberId, groupInstanceId, generationId, producerId, producerEpoch, - offsetMetadata, requestLocal, responseCallback) + + val offsetTopicPartition = new TopicPartition(Topic.GROUP_METADATA_TOPIC_NAME, partitionFor(group.groupId)) + + def postVerificationCallback( + error: Errors, + newRequestLocal: RequestLocal, + verificationGuard: VerificationGuard + ): Unit = { + if (error != Errors.NONE) { + val finalError = error match { + case Errors.NOT_ENOUGH_REPLICAS => Errors.COORDINATOR_NOT_AVAILABLE + case e => e + } + responseCallback(offsetMetadata.map { case (k, _) => k -> finalError }) + } else { + doTxnCommitOffsets(group, memberId, groupInstanceId, generationId, producerId, producerEpoch, + offsetTopicPartition, offsetMetadata, newRequestLocal, responseCallback, Some(verificationGuard)) + } + } + + groupManager.replicaManager.maybeStartTransactionVerificationForPartition( Review Comment: i was just about to push my change before I saw this comment. I will address this comment tomorrow. -- 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-unsubscr...@kafka.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org