You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ignite.apache.org by "Vladislav Pyatkov (Jira)" <ji...@apache.org> on 2023/10/27 17:37:00 UTC

[jira] [Commented] (IGNITE-20534) Transactions. It is possible to call enlist on a rollbacked transaction and cause a resource leak

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

Vladislav Pyatkov commented on IGNITE-20534:
--------------------------------------------

Merged 10e94521c0f3d0fcb30d9ee54b4874cdd007b3b4

> Transactions. It is possible to call enlist on a rollbacked transaction and cause a resource leak
> -------------------------------------------------------------------------------------------------
>
>                 Key: IGNITE-20534
>                 URL: https://issues.apache.org/jira/browse/IGNITE-20534
>             Project: Ignite
>          Issue Type: Improvement
>    Affects Versions: 3.0.0-beta2
>            Reporter: Maksim Zhuravkov
>            Assignee: Vladislav Pyatkov
>            Priority: Major
>              Labels: ignite-3
>          Time Spent: 3h 40m
>  Remaining Estimate: 0h
>
> It is possible to rollback a transaction, invoke a modification operation on some table, open another transaction and get 'Failed to acquire a lock due to a conflict' when accessing that table.
> Reproducer:
> {code:java}
>  @Test
>     public void testLockIsNotReleasedAfterTxRollback() {
>         Ignite ignite = CLUSTER_NODES.get(0);
>         IgniteSql sql = ignite.sql();
>         try (Session ses = ignite.sql().createSession()) {
>             ses.execute(null, "CREATE TABLE IF NOT EXISTS tst(id INTEGER PRIMARY KEY, val INTEGER)").affectedRows();
>         }
>         try (Session session = sql.createSession()) {
>             Transaction tx = ignite.transactions().begin();
>             assertThrows(RuntimeException.class, () -> session.execute(tx, "SELECT 1/0"));
>             tx.rollback();
>             session.execute(tx, "INSERT INTO tst VALUES (1, 1)"); // if this line is commented out, everything works fine.
>         }
>         try (Session session = sql.createSession()) {
>             Transaction tx = ignite.transactions().begin(new TransactionOptions().readOnly(false));
>             session.execute(tx, "INSERT INTO tst VALUES (1, 1)"); //IGN-TX-4 TraceId:20441aa3-c3fb-4900-a78f-b2cb4585e314 Failed to acquire a lock due to a conflict [txId=018af087-fb6b-0000-0000-0000e9bae05c, conflictingWaiter=WaiterImpl [txId=018af087-f595-0000-0000-0000e9bae05c, intendedLockMode=null, lockMode=X, ex=null, isDone=true]]
>             tx.commit(); 
>         }
>     }
> {code} 



--
This message was sent by Atlassian Jira
(v8.20.10#820010)