[
https://issues.apache.org/jira/browse/IGNITE-29348?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Kirill Tkalenko updated IGNITE-29348:
-------------------------------------
Description:
When one invoke() removes an entry, the next invoke() on the same key in the
same transaction still sees the entry as present.
KV reproduction
Use a transactional cache.
cache.put(1, 10);
try (Transaction tx = ignite.transactions().txStart(PESSIMISTIC,
READ_COMMITTED)) {
cache.invoke(1, (entry, args) -> \{ entry.remove(); return null; });
boolean exists = cache.invoke(1, (entry, args) -> entry.exists()); //
Expected false, got true.
}
Calcite reproduction
On a transactional table t(id INT PRIMARY KEY, val INT) containing (1, 10), run
both statements in the same transaction.
DELETE FROM t WHERE id = 1;
INSERT INTO t VALUES (1, 20); -- Expected success, got DUPLICATE_KEY.
was:
When one {{invoke()}} removes an entry, the next {{invoke()}} on the same key
in the same transaction still sees the entry as present.
*KV reproduction*
Use a transactional cache.
{code:java}
cache.put(1, 10);
try (Transaction tx = ignite.transactions().txStart(PESSIMISTIC,
READ_COMMITTED)) {
cache.invoke(1, (entry, args) -> { entry.remove(); return null; });
boolean exists = cache.invoke(1, (entry, args) -> entry.exists()); //
Expected false, got true.
}{code}
{code:java}
{code}
*Calcite reproduction*
On a transactional table {{t(id INT PRIMARY KEY, val INT)}} containing {{{}(1,
10){}}}, run both statements in the same transaction.
{code:java}
DELETE FROM t WHERE id = 1;
INSERT INTO t VALUES (1, 20); -- Expected success, got DUPLICATE_KEY.{code}
> Chained cache invoke() calls mishandle removal within a transaction
> -------------------------------------------------------------------
>
> Key: IGNITE-29348
> URL: https://issues.apache.org/jira/browse/IGNITE-29348
> Project: Ignite
> Issue Type: Bug
> Affects Versions: 2.18
> Reporter: Kirill Tkalenko
> Assignee: Kirill Tkalenko
> Priority: Major
> Labels: ignite-2
>
> When one invoke() removes an entry, the next invoke() on the same key in the
> same transaction still sees the entry as present.
> KV reproduction
> Use a transactional cache.
> cache.put(1, 10);
> try (Transaction tx = ignite.transactions().txStart(PESSIMISTIC,
> READ_COMMITTED)) {
> cache.invoke(1, (entry, args) -> \{ entry.remove(); return null; });
> boolean exists = cache.invoke(1, (entry, args) -> entry.exists()); //
> Expected false, got true.
> }
> Calcite reproduction
> On a transactional table t(id INT PRIMARY KEY, val INT) containing (1, 10),
> run both statements in the same transaction.
> DELETE FROM t WHERE id = 1;
> INSERT INTO t VALUES (1, 20); -- Expected success, got DUPLICATE_KEY.
>
--
This message was sent by Atlassian Jira
(v10.3.26#10030026)