[ 
https://issues.apache.org/jira/browse/IGNITE-23159?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Alexey Scherbakov updated IGNITE-23159:
---------------------------------------
    Description: 
Let's assume a table:
{noformat}
Goods:
id int primary key
name: varchar
category: varchar, indexed with non-unique index
{noformat}
and the following scenario, where two transaction are executed concurrently on 
nodes A and B:

A: tx1: insert (1, Apple, Fruits); // takes IX lock
B: tx2: scan(Fruits) // found nothing, locks nothing
B: tx1: insert(2, Peach, Fruits); // takes IX lock
A: tx2:scan(Fruits) // waits for IX lock release to take S lock
tx1:commit
A: tx2: unlocked and reads Apple by index and finished

Serializability is broken, because tx2 didn't saw Peach and was ordered later.
This needs to be fixed by taking index locks both on nodes A and B.

Note that this can also be addressed by implementing distribution zones for 
indexes.

The same issue is applied to sorted indexes.

  was:
Let's assume a table:
{noformat}
Goods:
id int primary key
name: varchar
category: varchar, indexed with non-unique index
{noformat}
and the following scenario, where two transaction are executed concurrently on 
nodes A and B:

A: tx1: insert (1, Apple, Fruits); // takes IX lock
B: tx2: scan(Fruits) // found nothing, locks nothing
B: tx1: insert(2, Peach, Fruits); // takes IX lock
A: tx2:scan(Fruits) // waits for IX lock release to take S lock
tx1:commit
A: tx2: unlocked and reads Apple by index and finished

Serializability is broken, because tx2 doesn't see Peach and ordered later.
This needs to be fixed by taking index locks both on nodes A and B.

Note that this can also be addressed by implementing distribution zones for 
indexes.

The same issue is applied to sorted indexes.


> Fix broken serializability
> --------------------------
>
>                 Key: IGNITE-23159
>                 URL: https://issues.apache.org/jira/browse/IGNITE-23159
>             Project: Ignite
>          Issue Type: Bug
>            Reporter: Alexey Scherbakov
>            Priority: Major
>              Labels: ignite-3
>             Fix For: 3.0
>
>
> Let's assume a table:
> {noformat}
> Goods:
> id int primary key
> name: varchar
> category: varchar, indexed with non-unique index
> {noformat}
> and the following scenario, where two transaction are executed concurrently 
> on nodes A and B:
> A: tx1: insert (1, Apple, Fruits); // takes IX lock
> B: tx2: scan(Fruits) // found nothing, locks nothing
> B: tx1: insert(2, Peach, Fruits); // takes IX lock
> A: tx2:scan(Fruits) // waits for IX lock release to take S lock
> tx1:commit
> A: tx2: unlocked and reads Apple by index and finished
> Serializability is broken, because tx2 didn't saw Peach and was ordered later.
> This needs to be fixed by taking index locks both on nodes A and B.
> Note that this can also be addressed by implementing distribution zones for 
> indexes.
> The same issue is applied to sorted indexes.



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

Reply via email to