Konstantin Orlov created IGNITE-19329:
-----------------------------------------

             Summary: Tx. POSITIVE_INF inside SortedIndexLocker is not unique 
across partitions
                 Key: IGNITE-19329
                 URL: https://issues.apache.org/jira/browse/IGNITE-19329
             Project: Ignite
          Issue Type: Bug
            Reporter: Konstantin Orlov


POSITIVE_INF is a static constant using to take lock on positive infinite if no 
more key available in the cursor. The problem is that this value is not unique 
across different partitions, resulting in cross partition interference. Assume 
the following case:


{code:java}
        sql("CREATE TABLE test (id INT, aff_key INT, val INT, PRIMARY KEY (id, 
aff_key)) COLOCATE BY (aff_key) ");
        sql("CREATE INDEX test_val_asc_idx ON test (val ASC)");
        sql("INSERT INTO test VALUES (1, 1, 1), (2, 1, 2), (3, 1, 3)");

        Transaction tx = CLUSTER_NODES.get(0).transactions().begin();

        sql(tx, "SELECT * FROM test WHERE val <= 1 ORDER BY val");

        sql("INSERT INTO test VALUES (4, 1, 4)"); // <-- this INSERT uses 
implicit transaction
{code}

Expected behaviour is that second insert completes without delays or errors, 
but {{LockException: IGN-TX-4 TraceId:cd2e7f6f-ca7b-47aa-9a42-9398517660f3 
Failed to acquire a lock due to a conflict}} is thrown (according to current 
mode of deadlock prevention).




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

Reply via email to