You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ignite.apache.org by "Alexey Scherbakov (Jira)" <ji...@apache.org> on 2024/09/06 14:39:00 UTC

[jira] [Resolved] (IGNITE-23159) Fix broken serializability of transactions on tables having secondary indexes

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

Alexey Scherbakov resolved IGNITE-23159.
----------------------------------------
    Resolution: Won't Fix

The described scenario is incorrect. The valid behavior for hash index is:

A: tx1: insert (1, Apple, Fruits); // takes IX lock
B: tx2: scan(Fruits) // takes S lock on non existent key

..

so serialization is preserved.

> Fix broken serializability of transactions on tables having secondary indexes
> -----------------------------------------------------------------------------
>
>                 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, and primary keys 1 and 2 will be located on these nodes respectively:
> 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 see Peach and was ordered later, but did see Apple.
> This needs to be fixed by taking index locks both on nodes A and B (actually on all primary replicas), with waiting for all nodes to ack to lock acquisition on the index before inserting the value.
> This will have big performance impact, until is addressed by implementing separate distribution zones for indexes (requires a design).
> The same issue is applied to sorted indexes.



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