[ 
https://issues.apache.org/jira/browse/KAFKA-5260?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16021075#comment-16021075
 ] 

ASF GitHub Bot commented on KAFKA-5260:
---------------------------------------

GitHub user dguy opened a pull request:

    https://github.com/apache/kafka/pull/3126

    KAFKA-5260: Producer should not send AbortTxn unless transaction has 
actually begun

    Keep track of when a transaction has begun by setting a flag, 
`transactionStarted` when a successfull `AddPartitionsToTxnResponse` or 
`AddOffsetsToTxnResponse` had been received. If an `AbortTxnRequest` about to 
be sent and `transactionStarted` is false, don't send the request and 
transition the state to `READY`

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/dguy/kafka kafka-5260

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/kafka/pull/3126.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #3126
    
----
commit e8e86e764ddc24d193bcaf0c2ba440a92d0a2534
Author: Damian Guy <[email protected]>
Date:   2017-05-23T11:33:23Z

    don't send AbortTxn unless a transaction is Ongoing

----


> Producer should not send AbortTxn unless transaction has actually begun
> -----------------------------------------------------------------------
>
>                 Key: KAFKA-5260
>                 URL: https://issues.apache.org/jira/browse/KAFKA-5260
>             Project: Kafka
>          Issue Type: Sub-task
>          Components: clients, core, producer 
>            Reporter: Jason Gustafson
>            Assignee: Damian Guy
>            Priority: Blocker
>              Labels: exactly-once
>             Fix For: 0.11.0.0
>
>
> When there is an authorization error in AddOffsets or AddPartitions, the 
> producer will raise an authorization exception. When that happens, the user 
> should abort the transaction. The problem is that in an authorization error, 
> the coordinator will not have transitioned to a new state, so if it suddenly 
> receives an AbortTxnRequest, that request will fail with an InvalidTxnState, 
> which will be propagated to the error. The suggested solution is to keep 
> track locally when we are certain that no transaction has been officially 
> begun and to skip sending the AbortTxnRequest in that case.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

Reply via email to