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 2021/03/29 13:01:00 UTC
[jira] [Commented] (IGNITE-14425) Hang transactions in FINISH [COMMIT] phase when сommunication spi is blocked
[ https://issues.apache.org/jira/browse/IGNITE-14425?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17310648#comment-17310648 ]
Ignite TC Bot commented on IGNITE-14425:
----------------------------------------
{panel:title=Branch: [pull/8936/head] Base: [master] : No blockers found!|borderStyle=dashed|borderColor=#ccc|titleBGColor=#D6F7C1}{panel}
{panel:title=Branch: [pull/8936/head] Base: [master] : New Tests (3)|borderStyle=dashed|borderColor=#ccc|titleBGColor=#D6F7C1}
{color:#00008b}Cache 6{color} [[tests 3|https://ci.ignite.apache.org/viewLog.html?buildId=5936189]]
* {color:#013220}IgniteCacheTestSuite6: TxRollbackOnTimeoutNoDeadlockDetectionTest.testRollbackOnNearNodeLeft - PASSED{color}
* {color:#013220}IgniteCacheTestSuite6: TxRollbackOnTimeoutNearCacheTest.testRollbackOnNearNodeLeft - PASSED{color}
* {color:#013220}IgniteCacheTestSuite6: TxRollbackOnTimeoutTest.testRollbackOnNearNodeLeft - PASSED{color}
{panel}
[TeamCity *--> Run :: All* Results|https://ci.ignite.apache.org/viewLog.html?buildId=5936230&buildTypeId=IgniteTests24Java8_RunAll]
> Hang transactions in FINISH [COMMIT] phase when сommunication spi is blocked
> ----------------------------------------------------------------------------
>
> Key: IGNITE-14425
> URL: https://issues.apache.org/jira/browse/IGNITE-14425
> Project: Ignite
> Issue Type: Bug
> Reporter: Denis Chudov
> Assignee: Denis Chudov
> Priority: Major
> Time Spent: 10m
> Remaining Estimate: 0h
>
> scenario:
> From a client for two concurrent transactions on a single key.
> At the same time, the GridNearTxFinishRequest message is blocked from the client, a partial network failure is emulated, as a result, one of the transactions is not completed even if the node is no longer working
> Reproducer:
> (insert this test into *TxRollbackOnTimeoutTest*)
> {code:java}
> /**
> *
> */
> @Test
> public void testRollbackOnNearNodeLeft() throws Exception {
> Ignite client = startClient();
> Integer pk = primaryKey(grid(0).cache(CACHE_NAME));
> CountDownLatch locked = new CountDownLatch(1);
> CountDownLatch blocked = new CountDownLatch(1);
> IgniteInternalFuture<Void> fut = runAsync(new Callable<Void>() {
> @Override public Void call() throws Exception {
> try (Transaction tx0 = client.transactions().txStart()) {
> client.cache(CACHE_NAME).put(pk, 0);
> locked.countDown();
> U.awaitQuiet(blocked);
> tx0.commit();
> }
> catch (Exception e) {
> // Ignored.
> }
> return null;
> }
> });
> IgniteInternalFuture fut2 = runAsync(new Runnable() {
> @Override public void run() {
> try (Transaction tx1 = client.transactions().txStart(PESSIMISTIC, REPEATABLE_READ, 1000, 0)) {
> U.awaitQuiet(locked);
> TestRecordingCommunicationSpi.spi(client).blockMessages(new IgniteBiPredicate<ClusterNode, Message>() {
> @Override public boolean apply(ClusterNode clusterNode, Message msg) {
> return msg instanceof GridNearTxFinishRequest;
> }
> });
> TestRecordingCommunicationSpi.spi(grid(0)).blockMessages(new IgniteBiPredicate<ClusterNode, Message>() {
> @Override public boolean apply(ClusterNode clusterNode, Message msg) {
> return msg instanceof GridNearLockResponse;
> }
> });
> client.cache(CACHE_NAME).put(pk, 1);
> fail();
> }
> catch (Exception e) {
> assertTrue(X.hasCause(e, TransactionTimeoutException.class));
> }
> }
> });
> TestRecordingCommunicationSpi.spi(client).waitForBlocked();
> TestRecordingCommunicationSpi.spi(grid(0)).waitForBlocked();
> fut2.get();
> client.close();
> TestRecordingCommunicationSpi.spi(grid(0)).stopBlock();
> blocked.countDown();
> fut.get();
> assertTrue(grid(0).context().cache().context().tm().activeTransactions().isEmpty());
> }
> {code}
> As the result, transaction hangs on server node in MARKED_ROLLBACK state forever.
--
This message was sent by Atlassian Jira
(v8.3.4#803005)