Uploaded image for project: 'Kafka'
  1. Kafka
  2. KAFKA-14295

FetchMessageConversionsPerSec meter not recorded

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • None
    • 3.5.0, 3.4.1
    • None
    • None

    Description

      The broker topic metric FetchMessageConversionsPerSec doesn't get recorded on a fetch message conversion.

      The bug is that we pass in a callback that expects a MultiRecordsSend in KafkaApis:

      def updateConversionStats(send: Send): Unit = {
        send match {
          case send: MultiRecordsSend if send.recordConversionStats != null =>
            send.recordConversionStats.asScala.toMap.foreach {
              case (tp, stats) => updateRecordConversionStats(request, tp, stats)
            }
          case _ =>
        }
      } 

      But we call this callback with a NetworkSend in the SocketServer:

      selector.completedSends.forEach { send =>
        try {
          val response = inflightResponses.remove(send.destinationId).getOrElse {
            throw new IllegalStateException(s"Send for ${send.destinationId} completed, but not in `inflightResponses`")
          }
          updateRequestMetrics(response)
      
          // Invoke send completion callback
          response.onComplete.foreach(onComplete => onComplete(send))
      ...

      Note that Selector.completedSends returns a collection of NetworkSend

      Attachments

        Issue Links

          Activity

            People

              chia7712 Chia-Ping Tsai
              david.mao David Mao
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: