You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jira@kafka.apache.org by "ASF GitHub Bot (JIRA)" <ji...@apache.org> on 2017/10/26 18:17:00 UTC
[jira] [Commented] (KAFKA-6131) Transaction markers are sometimes
discarded if txns complete concurrently
[ https://issues.apache.org/jira/browse/KAFKA-6131?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16220946#comment-16220946 ]
ASF GitHub Bot commented on KAFKA-6131:
---------------------------------------
GitHub user rajinisivaram opened a pull request:
https://github.com/apache/kafka/pull/4140
KAFKA-6131: Use atomic putIfAbsent to create txn marker queues
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/rajinisivaram/kafka KAFKA-6131-txn-concurrentmap
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/kafka/pull/4140.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 #4140
----
commit b80fcb5bfc8cb70f270eb558ed6267dca99d1e08
Author: Rajini Sivaram <ra...@googlemail.com>
Date: 2017-10-26T17:45:47Z
KAFKA-6131: Use atomic putIfAbsent to create txn marker queues
----
> Transaction markers are sometimes discarded if txns complete concurrently
> -------------------------------------------------------------------------
>
> Key: KAFKA-6131
> URL: https://issues.apache.org/jira/browse/KAFKA-6131
> Project: Kafka
> Issue Type: Bug
> Components: core
> Affects Versions: 1.0.0
> Reporter: Rajini Sivaram
> Assignee: Rajini Sivaram
>
> Concurrent tests being added under KAFKA-6096 for transaction coordinator fail to complete some transactions when multiple transactions are completed concurrently.
> The problem is with the following code snippet - there are two very similar uses of concurrent map in {{TransactionMarkerChannelManager}} and the test fails because some transaction markers are discarded. {{getOrElseUpdate}} in scala maps are not atomic. The test passes consistently with one thread.
> {quote}
> val markersQueuePerBroker: concurrent.Map[Int, TxnMarkerQueue] = new ConcurrentHashMap[Int, TxnMarkerQueue]().asScala
> val brokerRequestQueue = markersQueuePerBroker.getOrElseUpdate(brokerId, new TxnMarkerQueue(broker))
> {quote}
--
This message was sent by Atlassian JIRA
(v6.4.14#64029)