Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Cross Exception handling doesn't match as mentioned in KIP-691


Exception Table 

Anchor
Exception TableexceptiontableException Table
exceptiontable

Exception/Error Names

Thrown scenarios during transaction

Current handling

Expected Handling



Producer API

Transaction API

Producer API

Transaction API

ErrorRetry


Producer Retriable

Producer Retriable

Producer Retriable

Producer Retriable

ErrorRefreshMetadataAndRetry


Refresh + Retriable

Refresh + Retriable

Refresh + Retriable

Refresh + Retriable

ErrorFenceClient


Application Recoverable

Application Recoverable

Application Recoverable

Application Recoverable

ErrorBadConfig


Invalid Configuration

Invalid Configuration

Invalid Configuration

Invalid Configuration

TransactionAbortableException
** note – Added via KIP-890


Producer Recoverable

Producer Recoverable

Producer Recoverable

Producer Recoverable

IllegalStateException


Abortable

Sometimes Fatal depending on whether application or Sender caused issue. See: kafka: KAFKA-14831: Illegal state errors should be fatal in transactional producerCLOSED

Application Recoverable (probably not expected) Image Modified

Application RecoverableImage Modified

Au thenticationException


Abortable

Fatal

Invalid Configuration Image Modified

Invalid Configuration (not expected) Image Modified

InvalidPidMappingException

  • If the TransactionalId does not exist in the TransactionalId mapping or if the mapped PID is different from that in the request, reply with InvalidPidMapping; otherwise proceed to next step.

Sometimes retriable (no longer returned) or abortable

Abortable

Application Recoverable Image Modified

Application Recoverable Image Modified

UnknownProducerIdException


Sometimes retriable (no longer returned) or abortable

Abortable

Application Recoverable Image Modified

Application Recoverable Image Modified

ClusterAuthorizationException

TransactionalIdAuthorizationException

UnsupportedVersionException

UnsupportedForMessageFormatException


Fatal, except UnsupportedForMessageFormatException which is Abortable

Cluster/Transaction Auth → abortable on InitProducerId, other errors abortable

TransactionAuth → fatal, others abortable for AddPartitions, Find Coordinator, EndTxn, AddOffsets

Transaction Auth, UnssupportedForMessageFormat → fatal for OffsetCommit

Invalid Configuration Image Modified

Invalid Configuration Image Modified

CorruptRecordException

NotEnoughReplicasAfterAppendException

NotEnoughReplicasException

TimeoutException


Retriable if the error is retriable. Otherwise abortable

Retriable if the error is retriable otherwise abortable

Producer Retriable Image Modified

Producer Retriable Image Modified

UnknownTopicOrPartitionException

NotLeaderOrFollowerException


Retriable if the error is retriable. Otherwise abortable

Retriable if the error is retriable otherwise abortable

Refresh + Retriable Image Modified

Refresh + Retriable Image Modified

InvalidRecordException

InvalidRequiredAcksException

RecordBatchTooLargeException

InvalidTopicException


Retriable if the error is retriable. Otherwise abortable

Retriable if the error is retriable otherwise abortable

Invalid Configuration Image Modified

Invalid Configuration Image Modified

TopicAuthorizationException

GroupAuthorizationException


Abortable

Abortable

Invalid Configuration Image Modified

Invalid Configuration Image Modified

FencedInstanceIdException

CommitFailedException

UnknownMemberIdException

IllegalGenerationExceiption


N/A

Abortable (TxnOffsetCommit Only)

N/A

Application Recoverable Image Modified

InvalidProducerEpochException

  • If the PID’s epoch number is different from the current TransactionalId PID mapping, reply with the InvalidProducerEpoch error code; otherwise proceed to next step.

Abortable

Fatal

Application Recoverable Image Modified

Application Recoverable Image Modified

ProducerFencedException


Fatal

Fatal

Application Recoverable Image Modified

Application Recoverable Image Modified

OutOfOrderSequenceException


Sometimes retriable or abortable

N/A

Producer Retriable Image Modified

N/A

InvalidTxnStateException

  • When client makes a request which involves change of Txn state. However expected state transition is invalid.
    e.g COMPLETE_ABORT to COMMIT

Abortable

Fatal

Producer Recoverable (KIP-890 relies on this – note this is the only one that differs with Produce API) Image Modified

Application Recoverable Image Modified

KafkaException


Abortable (default seems to be abortable)

Fatal in most cases, but abortable when there are partition errors

Application Recoverable (not expected) Image Modified

Application Recoverable (not expected) Image Modified

RuntimeException


Abortable (default seems to be abortable)

Fatal – only thrown as this generic type when correlation ID is wrong. This should be updated as KIP-691 suggests

Application Recoverable (not expected) Image Modified

Application Recoverable (not expected) Image Modified

ConcurrentTransactionsException


Retriable

Retriable

Producer Retriable (KIP-890 may see this)

Producer Retriable

CoordinatorLoadInProgressException


Retriable

Retriable

Producer Retriable

Producer Retriable

NotCoordinatorException

CoordinatorNotAvailableException

  • Check whether there is a previous entry with the same TransactionalId and a higher epoch. If so, throw an exception. In particular, this indicates the log is corrupt. All future transactional RPCs to this coordintaor will result in a `NotCoordinatorForTransactionalId` error code, and this partition of the log will be effectively disabled.

  • Check if it is the assigned transaction coordinator for the TransactionalId, if not reply with the NotCoordinatorForTransactionalId error code.

Retriable

Retriable

Refresh + Retriable

Refresh + Retriable

CorrelationIdMismatchException




Application Recoverable

Application Recoverable

Compatibility, Deprecation, and Migration Plan

...