Uploaded image for project: 'Flink'
  1. Flink
  2. FLINK-23668 Check Log Pollution for 1.14 release
  3. FLINK-23839

Unclear severity of Kafka transaction recommit warning in logs

    XMLWordPrintableJSON

Details

    Description

      In a transactional Kafka sink, after recovery, all transactions from the recovered checkpoint are recommitted even though they may have already been committed before because this is not part of the checkpoint.

      This second commit can lead to a number of WARN entries in the logs coming from KafkaCommitter or FlinkKafkaProducer.

      Examples:

      WARN [org.apache.flink.streaming.connectors.kafka.FlinkKafkaProducer] ... Encountered error org.apache.kafka.common.errors.InvalidTxnStateException: The producer attempted a transactional operation in an invalid state. while recovering transaction KafkaTransactionState [transactionalId=..., producerId=12345, epoch=123]. Presumably this transaction has been already committed before.
      
      WARN [org.apache.flink.streaming.connectors.kafka.FlinkKafkaProducer] ... Encountered error org.apache.kafka.common.errors.ProducerFencedException: Producer attempted an operation with an old epoch. Either there is a newer producer with the same transactionalId, or the producer's transaction has been expired by the broker. while recovering transaction KafkaTransactionState [transactionalId=..., producerId=12345, epoch=12345]. Presumably this transaction has been already committed before
      

      It sounds to me like the second exception is useful and indicates that the transaction timeout is too short. The first exception, however, seems superfluous and rather alerts the user more than it helps. Or what would you do with it?

      Can we instead filter out superfluous exceptions and at least put these onto DEBUG logs instead?

      Attachments

        Issue Links

          Activity

            People

              dmvk David Morávek
              nkruber Nico Kruber
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: