[
https://issues.apache.org/jira/browse/IGNITE-29376?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Kirill Tkalenko updated IGNITE-29376:
-------------------------------------
Description:
In one transaction, update a key with {{{}invoke(){}}}, then call {{invoke()}}
again on the same key with a processor that throws. Catch the exception and
call {{{}commit(){}}}.
Apply the same failure semantics during {{{}invoke(){}}}, prepare, and commit
so the primary and all backups agree on the resulting entry state.
On a {{TRANSACTIONAL}} cache with one backup and {{{}FULL_SYNC{}}}, a failed
{{invoke()}} can leave the primary and backup with different values after
commit.
{code:java}
cache.put(1, 10);try (Transaction tx =
ignite.transactions().txStart(PESSIMISTIC, READ_COMMITTED)) {
try {
cache.invoke(1, (entry, args) -> {
entry.remove();
throw new EntryProcessorException("Failed after remove");
});
}
catch (EntryProcessorException expected) {
tx.commit();
}
}
{code}
The primary keeps 10, while the backup deletes the key. Handle processor
failures consistently during invoke(), prepare, and commit so both nodes retain
10 in this case.
was:
In one transaction, update a key with {{{}invoke(){}}}, then call {{invoke()}}
again on the same key with a processor that throws. Catch the exception and
call {{{}commit(){}}}.
Apply the same failure semantics during {{{}invoke(){}}}, prepare, and commit
so the primary and all backups agree on the resulting entry state.
> Inconsistent handling of cache invoke() failures in transactions
> ----------------------------------------------------------------
>
> Key: IGNITE-29376
> URL: https://issues.apache.org/jira/browse/IGNITE-29376
> Project: Ignite
> Issue Type: Bug
> Affects Versions: 2.18
> Reporter: Kirill Tkalenko
> Assignee: Kirill Tkalenko
> Priority: Major
> Labels: cache, ignite-2
>
> In one transaction, update a key with {{{}invoke(){}}}, then call
> {{invoke()}} again on the same key with a processor that throws. Catch the
> exception and call {{{}commit(){}}}.
> Apply the same failure semantics during {{{}invoke(){}}}, prepare, and commit
> so the primary and all backups agree on the resulting entry state.
> On a {{TRANSACTIONAL}} cache with one backup and {{{}FULL_SYNC{}}}, a failed
> {{invoke()}} can leave the primary and backup with different values after
> commit.
> {code:java}
> cache.put(1, 10);try (Transaction tx =
> ignite.transactions().txStart(PESSIMISTIC, READ_COMMITTED)) {
> try {
> cache.invoke(1, (entry, args) -> {
> entry.remove();
> throw new EntryProcessorException("Failed after remove");
> });
> }
> catch (EntryProcessorException expected) {
> tx.commit();
> }
> }
> {code}
> The primary keeps 10, while the backup deletes the key. Handle processor
> failures consistently during invoke(), prepare, and commit so both nodes
> retain 10 in this case.
--
This message was sent by Atlassian Jira
(v10.3.26#10030026)