You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ignite.apache.org by "Ignite TC Bot (Jira)" <ji...@apache.org> on 2019/10/16 06:24:00 UTC

[jira] [Commented] (IGNITE-12292) Java thin client: In some cases txId intersection (tx started on different nodes) leads to errors

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

Ignite TC Bot commented on IGNITE-12292:
----------------------------------------

{panel:title=Branch: [pull/6979/head] Base: [master] : No blockers found!|borderStyle=dashed|borderColor=#ccc|titleBGColor=#D6F7C1}{panel}
[TeamCity *--&gt; Run :: Basic Tests* Results|https://ci.ignite.apache.org/viewLog.html?buildId=4699296&amp;buildTypeId=IgniteTests24Java8_RunBasicTests]

> Java thin client: In some cases txId intersection (tx started on different nodes) leads to errors
> -------------------------------------------------------------------------------------------------
>
>                 Key: IGNITE-12292
>                 URL: https://issues.apache.org/jira/browse/IGNITE-12292
>             Project: Ignite
>          Issue Type: Bug
>          Components: thin client
>    Affects Versions: 2.8
>            Reporter: Aleksey Plekhanov
>            Assignee: Aleksey Plekhanov
>            Priority: Major
>             Fix For: 2.8
>
>          Time Spent: 10m
>  Remaining Estimate: 0h
>
> Reproducer:
> {code:java}
> public void testTxWithIdIntersection() throws Exception {
>     int CLUSTER_SIZE = 2;
>     try (LocalIgniteCluster cluster = LocalIgniteCluster.start(CLUSTER_SIZE);
>          IgniteClient client = Ignition.startClient(new ClientConfiguration()
>              .setAddresses(cluster.clientAddresses().toArray(new String[CLUSTER_SIZE])))
>     ) {
>         ClientCache<Integer, Integer> cache = client.createCache(new ClientCacheConfiguration().setName("cache")
>             .setAtomicityMode(CacheAtomicityMode.TRANSACTIONAL));
>         CyclicBarrier barrier = new CyclicBarrier(2);
>         GridTestUtils.runAsync(() -> {
>             try {
>                 // Another thread starts transaction here.
>                 barrier.await(1, TimeUnit.SECONDS);
>                 for (int i = 0; i < CLUSTER_SIZE; i++)
>                     dropAllThinClientConnections(Ignition.allGrids().get(i));
>                 ClientTransaction tx = client.transactions().txStart();
>                 barrier.await(1, TimeUnit.SECONDS);
>                 // Another thread puts to cache here.
>                 barrier.await(1, TimeUnit.SECONDS);
>                 tx.commit();
>                 barrier.await(1, TimeUnit.SECONDS);
>             }
>             catch (Exception e) {
>                 log.error("Unexpected error", e);
>             }
>         });
>         ClientTransaction tx = client.transactions().txStart();
>         barrier.await(1, TimeUnit.SECONDS);
>         // Another thread drops connections and create new transaction here, which started on another node with the
>         // same transaction id as we started in this thread.
>         barrier.await(1, TimeUnit.SECONDS);
>         try {
>             cache.put(0, 0);
>             fail("Exception expected");
>         }
>         catch (ClientException expected) {
>             // No-op.
>         }
>         tx.close();
>         barrier.await(1, TimeUnit.SECONDS);
>         // Another thread commit transaction here.
>         barrier.await(1, TimeUnit.SECONDS);
>         assertFalse(cache.containsKey(0));
>     }
> }
> {code}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)