Class TransactionManagerTest
java.lang.Object
org.apache.kafka.clients.producer.internals.TransactionManagerTest
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidvoidsetup()voidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidtestBatchCompletedAfterProducerReset(boolean transactionV2Enabled) voidtestBatchFailureAfterProducerReset(boolean transactionV2Enabled) voidtestBumpEpochAfterTimeoutWithoutPendingInflightRequests(boolean transactionV2Enabled) voidtestBumpEpochAndResetSequenceNumbersAfterUnknownProducerId(boolean transactionV2Enabled) voidtestBumpTransactionalEpochOnAbortableError(boolean transactionV2Enabled) voidvoidvoidvoidvoidvoidvoidvoidvoidvoidtestDefaultSequenceNumber(boolean transactionV2Enabled) voidvoidvoidvoidtestDuplicateSequenceAfterProducerReset(boolean transactionV2Enabled) voidvoidtestEpochBumpAfterLastInFlightBatchFailsIdempotentProducer(boolean transactionV2Enabled) voidvoidtestFailedInflightBatchAfterEpochBump(boolean transactionV2Enabled) voidvoidvoidtestFailIfNotReadyForSendIdempotentProducer(boolean transactionV2Enabled) voidtestFailIfNotReadyForSendIdempotentProducerFatalError(boolean transactionV2Enabled) voidvoidvoidvoidvoidvoidvoidvoidvoidvoidtestGroupMetadataMismatchErrorInTxnOffsetCommit(org.apache.kafka.common.protocol.Errors error) voidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidtestHealthyPartitionRetriesDuringEpochBump(boolean transactionV2Enabled) voidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidtestMaybeResolveSequencesTransactionalProducer(boolean transactionV2Enabled) voidvoidvoidvoidtestNoFailedBatchHandlingWhenTxnManagerIsInFatalError(boolean transactionV2Enabled) voidtestNoProducerIdResetAfterLastInFlightBatchSucceeds(boolean transactionV2Enabled) voidvoidvoidvoidvoidvoidvoidvoidvoidtestProducerIdReset(boolean transactionV2Enabled) voidvoidvoidvoidvoidtestRetriableErrors(org.apache.kafka.common.protocol.Errors error) voidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidtestSequenceNumberOverflow(boolean transactionV2Enabled) voidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoid
-
Constructor Details
-
TransactionManagerTest
public TransactionManagerTest()
-
-
Method Details
-
setup
@BeforeEach public void setup() -
testSenderShutdownWithPendingTransactions
-
testEndTxnNotSentIfIncompleteBatches
@Test public void testEndTxnNotSentIfIncompleteBatches() -
testFailIfNotReadyForSendNoProducerId
@Test public void testFailIfNotReadyForSendNoProducerId() -
testFailIfNotReadyForSendIdempotentProducer
@ParameterizedTest @ValueSource(booleans={true,false}) public void testFailIfNotReadyForSendIdempotentProducer(boolean transactionV2Enabled) -
testFailIfNotReadyForSendIdempotentProducerFatalError
@ParameterizedTest @ValueSource(booleans={true,false}) public void testFailIfNotReadyForSendIdempotentProducerFatalError(boolean transactionV2Enabled) -
testFailIfNotReadyForSendNoOngoingTransaction
@Test public void testFailIfNotReadyForSendNoOngoingTransaction() -
testFailIfNotReadyForSendAfterAbortableError
@Test public void testFailIfNotReadyForSendAfterAbortableError() -
testFailIfNotReadyForSendAfterFatalError
@Test public void testFailIfNotReadyForSendAfterFatalError() -
testHasOngoingTransactionSuccessfulAbort
@Test public void testHasOngoingTransactionSuccessfulAbort() -
testHasOngoingTransactionSuccessfulCommit
@Test public void testHasOngoingTransactionSuccessfulCommit() -
testHasOngoingTransactionAbortableError
@Test public void testHasOngoingTransactionAbortableError() -
testHasOngoingTransactionFatalError
@Test public void testHasOngoingTransactionFatalError() -
testMaybeAddPartitionToTransaction
@Test public void testMaybeAddPartitionToTransaction() -
testMaybeAddPartitionToTransactionInTransactionV2
@Test public void testMaybeAddPartitionToTransactionInTransactionV2() -
testAddPartitionToTransactionOverridesRetryBackoffForConcurrentTransactions
@Test public void testAddPartitionToTransactionOverridesRetryBackoffForConcurrentTransactions() -
testAddPartitionToTransactionRetainsRetryBackoffForRegularRetriableError
@Test public void testAddPartitionToTransactionRetainsRetryBackoffForRegularRetriableError() -
testAddPartitionToTransactionRetainsRetryBackoffWhenPartitionsAlreadyAdded
@Test public void testAddPartitionToTransactionRetainsRetryBackoffWhenPartitionsAlreadyAdded() -
testNotReadyForSendBeforeInitTransactions
@Test public void testNotReadyForSendBeforeInitTransactions() -
testNotReadyForSendBeforeBeginTransaction
@Test public void testNotReadyForSendBeforeBeginTransaction() -
testNotReadyForSendAfterAbortableError
@Test public void testNotReadyForSendAfterAbortableError() -
testNotReadyForSendAfterFatalError
@Test public void testNotReadyForSendAfterFatalError() -
testIsSendToPartitionAllowedWithPendingPartitionAfterAbortableError
@Test public void testIsSendToPartitionAllowedWithPendingPartitionAfterAbortableError() -
testIsSendToPartitionAllowedWithInFlightPartitionAddAfterAbortableError
@Test public void testIsSendToPartitionAllowedWithInFlightPartitionAddAfterAbortableError() -
testIsSendToPartitionAllowedWithPendingPartitionAfterFatalError
@Test public void testIsSendToPartitionAllowedWithPendingPartitionAfterFatalError() -
testIsSendToPartitionAllowedWithInFlightPartitionAddAfterFatalError
@Test public void testIsSendToPartitionAllowedWithInFlightPartitionAddAfterFatalError() -
testIsSendToPartitionAllowedWithAddedPartitionAfterAbortableError
@Test public void testIsSendToPartitionAllowedWithAddedPartitionAfterAbortableError() -
testIsSendToPartitionAllowedWithAddedPartitionAfterFatalError
@Test public void testIsSendToPartitionAllowedWithAddedPartitionAfterFatalError() -
testIsSendToPartitionAllowedWithPartitionNotAdded
@Test public void testIsSendToPartitionAllowedWithPartitionNotAdded() -
testDefaultSequenceNumber
@ParameterizedTest @ValueSource(booleans={true,false}) public void testDefaultSequenceNumber(boolean transactionV2Enabled) -
testBumpEpochAndResetSequenceNumbersAfterUnknownProducerId
@ParameterizedTest @ValueSource(booleans={true,false}) public void testBumpEpochAndResetSequenceNumbersAfterUnknownProducerId(boolean transactionV2Enabled) -
testBatchFailureAfterProducerReset
@ParameterizedTest @ValueSource(booleans={true,false}) public void testBatchFailureAfterProducerReset(boolean transactionV2Enabled) -
testBatchCompletedAfterProducerReset
@ParameterizedTest @ValueSource(booleans={true,false}) public void testBatchCompletedAfterProducerReset(boolean transactionV2Enabled) -
testDuplicateSequenceAfterProducerReset
-
testSequenceNumberOverflow
@ParameterizedTest @ValueSource(booleans={true,false}) public void testSequenceNumberOverflow(boolean transactionV2Enabled) -
testProducerIdReset
@ParameterizedTest @ValueSource(booleans={true,false}) public void testProducerIdReset(boolean transactionV2Enabled) -
testBasicTransaction
- Throws:
InterruptedException
-
testTransactionManagerEnablesV2
@Test public void testTransactionManagerEnablesV2() -
testTransactionV2AddPartitionAndOffsets
- Throws:
InterruptedException
-
testTransactionManagerDisablesV2
@Test public void testTransactionManagerDisablesV2() -
testDisconnectAndRetry
@Test public void testDisconnectAndRetry() -
testInitializeTransactionsTwiceRaisesError
@Test public void testInitializeTransactionsTwiceRaisesError() -
testUnsupportedFindCoordinator
@Test public void testUnsupportedFindCoordinator() -
testUnsupportedInitTransactions
@Test public void testUnsupportedInitTransactions() -
testUnsupportedForMessageFormatInTxnOffsetCommit
@Test public void testUnsupportedForMessageFormatInTxnOffsetCommit() -
testFencedInstanceIdInTxnOffsetCommitByGroupMetadata
@Test public void testFencedInstanceIdInTxnOffsetCommitByGroupMetadata() -
testUnknownMemberIdInTxnOffsetCommitByGroupMetadata
@Test public void testUnknownMemberIdInTxnOffsetCommitByGroupMetadata() -
testIllegalGenerationInTxnOffsetCommitByGroupMetadata
@Test public void testIllegalGenerationInTxnOffsetCommitByGroupMetadata() -
testGroupMetadataMismatchErrorInTxnOffsetCommit
@ParameterizedTest @EnumSource(value=org.apache.kafka.common.protocol.Errors.class, names={"GROUP_ID_NOT_FOUND","STALE_MEMBER_EPOCH"}) public void testGroupMetadataMismatchErrorInTxnOffsetCommit(org.apache.kafka.common.protocol.Errors error) -
testLookupCoordinatorOnDisconnectAfterSend
@Test public void testLookupCoordinatorOnDisconnectAfterSend() -
testLookupCoordinatorOnDisconnectBeforeSend
@Test public void testLookupCoordinatorOnDisconnectBeforeSend() -
testLookupCoordinatorOnNotCoordinatorError
@Test public void testLookupCoordinatorOnNotCoordinatorError() -
testTransactionalIdAuthorizationFailureInFindCoordinator
@Test public void testTransactionalIdAuthorizationFailureInFindCoordinator() -
testTransactionalIdAuthorizationFailureInInitProducerId
@Test public void testTransactionalIdAuthorizationFailureInInitProducerId() -
testGroupAuthorizationFailureInFindCoordinator
@Test public void testGroupAuthorizationFailureInFindCoordinator() -
testGroupAuthorizationFailureInTxnOffsetCommit
@Test public void testGroupAuthorizationFailureInTxnOffsetCommit() -
testFatalErrorWhenProduceResponseWithInvalidPidMapping
@Test public void testFatalErrorWhenProduceResponseWithInvalidPidMapping() throws InterruptedException- Throws:
InterruptedException
-
testTransactionalIdAuthorizationFailureInAddOffsetsToTxn
@Test public void testTransactionalIdAuthorizationFailureInAddOffsetsToTxn() -
testInvalidTxnStateFailureInAddOffsetsToTxn
@Test public void testInvalidTxnStateFailureInAddOffsetsToTxn() -
testTransactionalIdAuthorizationFailureInTxnOffsetCommit
@Test public void testTransactionalIdAuthorizationFailureInTxnOffsetCommit() -
testTopicAuthorizationFailureInAddPartitions
- Throws:
InterruptedException
-
testCommitWithTopicAuthorizationFailureInAddPartitionsInFlight
@Test public void testCommitWithTopicAuthorizationFailureInAddPartitionsInFlight() throws InterruptedException- Throws:
InterruptedException
-
testRecoveryFromAbortableErrorTransactionNotStarted
-
testRetryAbortTransactionAfterTimeout
-
testRetryCommitTransactionAfterTimeout
-
testRetryInitTransactionsAfterTimeout
@Test public void testRetryInitTransactionsAfterTimeout() -
testRecoveryFromAbortableErrorTransactionStarted
-
testRecoveryFromAbortableErrorProduceRequestInRetry
-
testTransactionalIdAuthorizationFailureInAddPartitions
@Test public void testTransactionalIdAuthorizationFailureInAddPartitions() -
testInvalidTxnStateInAddPartitions
@Test public void testInvalidTxnStateInAddPartitions() -
testFlushPendingPartitionsOnCommit
- Throws:
InterruptedException
-
testMultipleAddPartitionsPerForOneProduce
- Throws:
InterruptedException
-
testRetriableErrors
@ParameterizedTest @EnumSource(names={"UNKNOWN_TOPIC_OR_PARTITION","REQUEST_TIMED_OUT","COORDINATOR_LOAD_IN_PROGRESS","CONCURRENT_TRANSACTIONS"}) public void testRetriableErrors(org.apache.kafka.common.protocol.Errors error) -
testCoordinatorNotAvailable
@Test public void testCoordinatorNotAvailable() -
testProducerFencedExceptionInInitProducerId
@Test public void testProducerFencedExceptionInInitProducerId() -
testInvalidProducerEpochConvertToProducerFencedInInitProducerId
@Test public void testInvalidProducerEpochConvertToProducerFencedInInitProducerId() -
testProducerFencedInAddPartitionToTxn
- Throws:
InterruptedException
-
testInvalidProducerEpochConvertToProducerFencedInAddPartitionToTxn
@Test public void testInvalidProducerEpochConvertToProducerFencedInAddPartitionToTxn() throws InterruptedException- Throws:
InterruptedException
-
testProducerFencedInAddOffSetsToTxn
- Throws:
InterruptedException
-
testInvalidProducerEpochConvertToProducerFencedInAddOffSetsToTxn
@Test public void testInvalidProducerEpochConvertToProducerFencedInAddOffSetsToTxn() throws InterruptedException- Throws:
InterruptedException
-
testInvalidProducerEpochConvertToProducerFencedInEndTxn
@Test public void testInvalidProducerEpochConvertToProducerFencedInEndTxn() throws InterruptedException- Throws:
InterruptedException
-
testInvalidProducerEpochFromProduce
- Throws:
InterruptedException
-
testDisallowCommitOnProduceFailure
- Throws:
InterruptedException
-
testAllowAbortOnProduceFailure
- Throws:
InterruptedException
-
testAbortableErrorWhileAbortInProgress
- Throws:
InterruptedException
-
testCommitTransactionWithUnsentProduceRequest
-
testCommitTransactionWithInFlightProduceRequest
-
testFindCoordinatorAllowedInAbortableErrorState
- Throws:
InterruptedException
-
testCancelUnsentAddPartitionsAndProduceOnAbort
- Throws:
InterruptedException
-
testAbortResendsAddPartitionErrorIfRetried
- Throws:
InterruptedException
-
testAbortResendsProduceRequestIfRetried
-
testHandlingOfUnknownTopicPartitionErrorOnAddPartitions
@Test public void testHandlingOfUnknownTopicPartitionErrorOnAddPartitions() throws InterruptedException- Throws:
InterruptedException
-
testHandlingOfUnknownTopicPartitionErrorOnTxnOffsetCommit
@Test public void testHandlingOfUnknownTopicPartitionErrorOnTxnOffsetCommit() -
testHandlingOfCoordinatorLoadingErrorOnTxnOffsetCommit
@Test public void testHandlingOfCoordinatorLoadingErrorOnTxnOffsetCommit() -
testHandlingOfNetworkExceptionOnTxnOffsetCommit
@Test public void testHandlingOfNetworkExceptionOnTxnOffsetCommit() -
testHandlingOfProducerFencedErrorOnTxnOffsetCommit
@Test public void testHandlingOfProducerFencedErrorOnTxnOffsetCommit() -
testHandlingOfTransactionalIdAuthorizationFailedErrorOnTxnOffsetCommit
@Test public void testHandlingOfTransactionalIdAuthorizationFailedErrorOnTxnOffsetCommit() -
testHandlingOfInvalidProducerEpochErrorOnTxnOffsetCommit
@Test public void testHandlingOfInvalidProducerEpochErrorOnTxnOffsetCommit() -
testHandlingOfUnsupportedForMessageFormatErrorOnTxnOffsetCommit
@Test public void testHandlingOfUnsupportedForMessageFormatErrorOnTxnOffsetCommit() -
testTxnOffsetCommitNegotiatesV6WhenAllTopicIdsAreAvailable
@Test public void testTxnOffsetCommitNegotiatesV6WhenAllTopicIdsAreAvailable() -
testTxnOffsetCommitDowngradesToV5WhenAnyTopicIdIsMissing
@Test public void testTxnOffsetCommitDowngradesToV5WhenAnyTopicIdIsMissing() -
testTxnOffsetCommitRetriesOnUnknownTopicIdAtV6
@Test public void testTxnOffsetCommitRetriesOnUnknownTopicIdAtV6() -
shouldNotAddPartitionsToTransactionWhenTopicAuthorizationFailed
-
shouldNotSendAbortTxnRequestWhenOnlyAddPartitionsRequestFailed
@Test public void shouldNotSendAbortTxnRequestWhenOnlyAddPartitionsRequestFailed() -
shouldNotSendAbortTxnRequestWhenOnlyAddOffsetsRequestFailed
@Test public void shouldNotSendAbortTxnRequestWhenOnlyAddOffsetsRequestFailed() -
shouldFailAbortIfAddOffsetsFailsWithFatalError
@Test public void shouldFailAbortIfAddOffsetsFailsWithFatalError() -
testSendOffsetsWithGroupMetadata
@Test public void testSendOffsetsWithGroupMetadata() -
testSendOffsetWithGroupMetadataFailAsAutoDowngradeTxnCommitNotEnabled
@Test public void testSendOffsetWithGroupMetadataFailAsAutoDowngradeTxnCommitNotEnabled() -
testNoDrainWhenPartitionsPending
- Throws:
InterruptedException
-
testAllowDrainInAbortableErrorState
- Throws:
InterruptedException
-
testRaiseErrorWhenNoPartitionsPendingOnDrain
- Throws:
InterruptedException
-
resendFailedProduceRequestAfterAbortableError
-
testTransitionToAbortableErrorOnBatchExpiry
- Throws:
InterruptedException
-
testTransitionToAbortableErrorOnMultipleBatchExpiry
- Throws:
InterruptedException
-
testDropCommitOnBatchExpiry
- Throws:
InterruptedException
-
testTransitionToFatalErrorWhenRetriedBatchIsExpired
- Throws:
InterruptedException
-
testBumpEpochAfterTimeoutWithoutPendingInflightRequests
@ParameterizedTest @ValueSource(booleans={true,false}) public void testBumpEpochAfterTimeoutWithoutPendingInflightRequests(boolean transactionV2Enabled) -
testNoProducerIdResetAfterLastInFlightBatchSucceeds
@ParameterizedTest @ValueSource(booleans={true,false}) public void testNoProducerIdResetAfterLastInFlightBatchSucceeds(boolean transactionV2Enabled) -
testEpochBumpAfterLastInFlightBatchFailsIdempotentProducer
@ParameterizedTest @ValueSource(booleans={true,false}) public void testEpochBumpAfterLastInFlightBatchFailsIdempotentProducer(boolean transactionV2Enabled) -
testMaybeResolveSequencesTransactionalProducer
@ParameterizedTest @ValueSource(booleans={true,false}) public void testMaybeResolveSequencesTransactionalProducer(boolean transactionV2Enabled) -
testEpochUpdateAfterBumpFromEndTxnResponseInV2
- Throws:
InterruptedException
-
testProducerIdAndEpochUpdateAfterOverflowFromEndTxnResponseInV2
@Test public void testProducerIdAndEpochUpdateAfterOverflowFromEndTxnResponseInV2() throws InterruptedException- Throws:
InterruptedException
-
testNoFailedBatchHandlingWhenTxnManagerIsInFatalError
@ParameterizedTest @ValueSource(booleans={true,false}) public void testNoFailedBatchHandlingWhenTxnManagerIsInFatalError(boolean transactionV2Enabled) -
testAbortTransactionAndReuseSequenceNumberOnError
- Throws:
InterruptedException
-
testAbortTransactionAndResetSequenceNumberOnUnknownProducerId
@Test public void testAbortTransactionAndResetSequenceNumberOnUnknownProducerId() throws InterruptedException- Throws:
InterruptedException
-
testBumpTransactionalEpochOnAbortableError
@ParameterizedTest @ValueSource(booleans={true,false}) public void testBumpTransactionalEpochOnAbortableError(boolean transactionV2Enabled) throws InterruptedException - Throws:
InterruptedException
-
testBumpTransactionalEpochOnUnknownProducerIdError
- Throws:
InterruptedException
-
testBumpTransactionalEpochOnTimeout
- Throws:
InterruptedException
-
testBumpTransactionalEpochOnRecoverableAddPartitionRequestError
@Test public void testBumpTransactionalEpochOnRecoverableAddPartitionRequestError() -
testBumpTransactionalEpochOnRecoverableAddOffsetsRequestError
@Test public void testBumpTransactionalEpochOnRecoverableAddOffsetsRequestError() throws InterruptedException- Throws:
InterruptedException
-
testHealthyPartitionRetriesDuringEpochBump
@ParameterizedTest @ValueSource(booleans={true,false}) public void testHealthyPartitionRetriesDuringEpochBump(boolean transactionV2Enabled) throws InterruptedException - Throws:
InterruptedException
-
testRetryAbortTransaction
- Throws:
InterruptedException
-
testRetryCommitTransaction
- Throws:
InterruptedException
-
testRetryAbortTransactionAfterCommitTimeout
@Test public void testRetryAbortTransactionAfterCommitTimeout() -
testRetryCommitTransactionAfterAbortTimeout
@Test public void testRetryCommitTransactionAfterAbortTimeout() -
testNeedToTriggerEpochBumpFromClientDuringCoordinatorDisconnect
@Test public void testNeedToTriggerEpochBumpFromClientDuringCoordinatorDisconnect() -
testFailedInflightBatchAfterEpochBump
@ParameterizedTest @ValueSource(booleans={true,false}) public void testFailedInflightBatchAfterEpochBump(boolean transactionV2Enabled) throws InterruptedException - Throws:
InterruptedException
-
testBackgroundInvalidStateTransitionIsFatal
@Test public void testBackgroundInvalidStateTransitionIsFatal() -
testForegroundInvalidStateTransitionIsRecoverable
@Test public void testForegroundInvalidStateTransitionIsRecoverable() -
testTransactionAbortableExceptionInInitProducerId
@Test public void testTransactionAbortableExceptionInInitProducerId() -
testTransactionAbortableExceptionInAddPartitions
@Test public void testTransactionAbortableExceptionInAddPartitions() -
testTransactionAbortableExceptionInFindCoordinator
@Test public void testTransactionAbortableExceptionInFindCoordinator() -
testTransactionAbortableExceptionInEndTxn
- Throws:
InterruptedException
-
testTransactionAbortableExceptionInAddOffsetsToTxn
@Test public void testTransactionAbortableExceptionInAddOffsetsToTxn() -
testTransactionAbortableExceptionInTxnOffsetCommit
@Test public void testTransactionAbortableExceptionInTxnOffsetCommit()
-