Rion Williams
09/06/2023, 1:19 PM2023-09-06 08:15:33
java.lang.IllegalStateException: Failed to commit KafkaCommittable{producerId=17310759, epoch=0, transactionalId=my-job-events-0-41817}
at org.apache.flink.streaming.runtime.operators.sink.committables.CommitRequestImpl.signalFailedWithUnknownReason(CommitRequestImpl.java:77)
at org.apache.flink.connector.kafka.sink.KafkaCommitter.commit(KafkaCommitter.java:119)
at org.apache.flink.streaming.runtime.operators.sink.committables.CheckpointCommittableManagerImpl.commit(CheckpointCommittableManagerImpl.java:127)
at org.apache.flink.streaming.runtime.operators.sink.CommitterOperator.commitAndEmit(CommitterOperator.java:176)
at org.apache.flink.streaming.runtime.operators.sink.CommitterOperator.commitAndEmitCheckpoints(CommitterOperator.java:160)
at org.apache.flink.streaming.runtime.operators.sink.CommitterOperator.initializeState(CommitterOperator.java:121)
at org.apache.flink.streaming.api.operators.StreamOperatorStateHandler.initializeOperatorState(StreamOperatorStateHandler.java:122)
at org.apache.flink.streaming.api.operators.AbstractStreamOperator.initializeState(AbstractStreamOperator.java:286)
at org.apache.flink.streaming.runtime.tasks.RegularOperatorChain.initializeStateAndOpenOperators(RegularOperatorChain.java:106)
at org.apache.flink.streaming.runtime.tasks.StreamTask.restoreGates(StreamTask.java:700)
at org.apache.flink.streaming.runtime.tasks.StreamTaskActionExecutor$1.call(StreamTaskActionExecutor.java:55)
at org.apache.flink.streaming.runtime.tasks.StreamTask.restoreInternal(StreamTask.java:676)
at org.apache.flink.streaming.runtime.tasks.StreamTask.restore(StreamTask.java:643)
at org.apache.flink.runtime.taskmanager.Task.runWithSystemExitMonitoring(Task.java:948)
at org.apache.flink.runtime.taskmanager.Task.restoreAndInvoke(Task.java:917)
at org.apache.flink.runtime.taskmanager.Task.doRun(Task.java:741)
at org.apache.flink.runtime.taskmanager.Task.run(Task.java:563)
at java.lang.Thread.run(Thread.java:750)
Caused by: org.apache.kafka.common.errors.InvalidPidMappingException: The producer attempted to use a producer id which is not currently assigned to its transactional id.
Is there some type of configuration that would allow to tolerate/ignore these types of errors? I reran the job using a different transaction-prefix, however it seems that the in-flight messages are all still pointing to older/expired transactions and throwing an exception at the sink-level.
Any advice/insight would be appreciated.Martijn Visser
09/06/2023, 1:20 PMMartijn Visser
09/06/2023, 1:21 PMRion Williams
09/06/2023, 1:26 PMMartijn Visser
09/06/2023, 1:27 PMRion Williams
09/06/2023, 1:32 PM2023-09-06 13:30:48,910 ERROR org.apache.flink.connector.kafka.sink.KafkaCommitter [] - Transaction (org.apache.flink.streaming.runtime.operators.sink.committables.CommitRequestImpl@17e2a69e) encountered error and data has been potentially lost.
org.apache.kafka.common.errors.InvalidPidMappingException: The producer attempted to use a producer id which is not currently assigned to its transactional id.
2023-09-06 13:30:48,911 INFO org.apache.kafka.clients.producer.KafkaProducer [] - [Producer clientId=producer-common-event-enrichment-pinot-investigate-events-0-41817, transactionalId=common-event-enrichment-pinot-investigate-events-0-41817] Closing the Kafka producer with timeoutMillis = 3600000 ms.
2023-09-06 13:30:48,911 INFO org.apache.kafka.clients.producer.internals.Sender [] - [Producer clientId=producer-common-event-enrichment-pinot-investigate-events-0-41817, transactionalId=common-event-enrichment-pinot-investigate-events-0-41817] Aborting incomplete transaction due to shutdown
2023-09-06 13:30:48,911 INFO org.apache.kafka.clients.producer.internals.TransactionManager [] - [Producer clientId=producer-common-event-enrichment-pinot-investigate-events-0-41817, transactionalId=common-event-enrichment-pinot-investigate-events-0-41817] Invoking InitProducerId with current producer ID and epoch (producerId=17311257, epoch=0) in order to bump the epoch
2023-09-06 13:30:48,912 INFO org.apache.kafka.clients.producer.internals.TransactionManager [] - [Producer clientId=producer-common-event-enrichment-pinot-investigate-events-0-41817, transactionalId=common-event-enrichment-pinot-investigate-events-0-41817] Transiting to fatal error state due to org.apache.kafka.common.errors.ProducerFencedException: There is a newer producer with the same transactionalId which fences the current one.
2023-09-06 13:30:48,914 INFO org.apache.kafka.common.metrics.Metrics [] - Metrics scheduler closed
2023-09-06 13:30:48,914 INFO org.apache.kafka.common.metrics.Metrics [] - Closing reporter org.apache.kafka.common.metrics.JmxReporter
2023-09-06 13:30:48,915 INFO org.apache.kafka.common.metrics.Metrics [] - Metrics reporters closed
2023-09-06 13:30:48,916 INFO org.apache.kafka.common.utils.AppInfoParser [] - App info kafka.producer for producer-common-event-enrichment-pinot-investigate-events-0-41817 unregistered
2023-09-06 13:30:48,916 WARN org.apache.flink.runtime.taskmanager.Task [] - filter-immutable-events -> map-immutable-enriched-events-to-common-events -> immutable-enriched-events-sink: Writer -> immutable-enriched-events-sink: Committer (1/1)#22708 (15f3b1b211815581ed5fbde18b9c6677) switched from INITIALIZING to FAILED with failure cause: java.lang.IllegalStateException: Failed to commit KafkaCommittable{producerId=17311257, epoch=0, transactionalId=common-event-enrichment-pinot-investigate-events-0-41817}
at org.apache.flink.streaming.runtime.operators.sink.committables.CommitRequestImpl.signalFailedWithUnknownReason(CommitRequestImpl.java:77)
at org.apache.flink.connector.kafka.sink.KafkaCommitter.commit(KafkaCommitter.java:119)
at org.apache.flink.streaming.runtime.operators.sink.committables.CheckpointCommittableManagerImpl.commit(CheckpointCommittableManagerImpl.java:127)
at org.apache.flink.streaming.runtime.operators.sink.CommitterOperator.commitAndEmit(CommitterOperator.java:176)
at org.apache.flink.streaming.runtime.operators.sink.CommitterOperator.commitAndEmitCheckpoints(CommitterOperator.java:160)
at org.apache.flink.streaming.runtime.operators.sink.CommitterOperator.initializeState(CommitterOperator.java:121)
at org.apache.flink.streaming.api.operators.StreamOperatorStateHandler.initializeOperatorState(StreamOperatorStateHandler.java:122)
at org.apache.flink.streaming.api.operators.AbstractStreamOperator.initializeState(AbstractStreamOperator.java:286)
at org.apache.flink.streaming.runtime.tasks.RegularOperatorChain.initializeStateAndOpenOperators(RegularOperatorChain.java:106)
at org.apache.flink.streaming.runtime.tasks.StreamTask.restoreGates(StreamTask.java:700)
at org.apache.flink.streaming.runtime.tasks.StreamTaskActionExecutor$1.call(StreamTaskActionExecutor.java:55)
at org.apache.flink.streaming.runtime.tasks.StreamTask.restoreInternal(StreamTask.java:676)
at org.apache.flink.streaming.runtime.tasks.StreamTask.restore(StreamTask.java:643)
at org.apache.flink.runtime.taskmanager.Task.runWithSystemExitMonitoring(Task.java:948)
at org.apache.flink.runtime.taskmanager.Task.restoreAndInvoke(Task.java:917)
at org.apache.flink.runtime.taskmanager.Task.doRun(Task.java:741)
at org.apache.flink.runtime.taskmanager.Task.run(Task.java:563)
at java.lang.Thread.run(Thread.java:750)Martijn Visser
09/06/2023, 1:34 PMRion Williams
09/06/2023, 1:34 PMTransiting to abortable error state due to org.apache.kafka.common.errors.InvalidPidMappingException: The producer attempted to use a producer id which is not currently assigned to its transactional id.
...
Transaction (org.apache.flink.streaming.runtime.operators.sink.committables.CommitRequestImpl@17e2a69e) encountered error and data has been potentially lost.
...
The producer attempted to use a producer id which is not currently assigned to its transactional id.
...
Transiting to fatal error state due to org.apache.kafka.common.errors.ProducerFencedException: There is a newer producer with the same transactionalId which fences the current one.
Historically, we have a parameter for the transaction-prefix that we used to update to handle “flushing” these bad transactions, but for whatever reason it’s continually restoring these in a crashloop.Martijn Visser
09/06/2023, 1:35 PMRion Williams
09/06/2023, 1:36 PMRion Williams
09/07/2023, 1:02 AMRion Williams
09/07/2023, 3:14 AM