ignite-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Denis Garus (Jira)" <j...@apache.org>
Subject [jira] [Commented] (IGNITE-12292) Java thin client: In some cases txId intersection (tx started on different nodes) leads to errors
Date Wed, 23 Oct 2019 09:47:00 GMT

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

Denis Garus commented on IGNITE-12292:
--------------------------------------

LGTM

> 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)

Mime
View raw message