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

Aleksandr Polovtcev updated IGNITE-20911:
-----------------------------------------
    Description: 
Test added in IGNITE-20910 fails with a {{PrimaryReplicaMissException}}. This 
happens, because after a node has been restarted, its Leases start to expire 
(which is a separate bug, by the way), which leads to the following chain of 
events:

# When a Tuple gets inserted, it ends up in the 
{{InternalTableImpl#enlistWithRetry}} method;
# Since the Primary Replica Lease has expired, 
{{InternalTableImpl#trackingInvoke}} will fail with a 
{{PrimaryReplicaMissException}}, which means that we should re-enlist the 
transaction again;
# When calling {{InternalTableImpl#enlist}} we acquire the new Lease by calling 
{{placementDriver.awaitPrimaryReplica}};
# This information is then passed to {{ReadWriteTransactionImpl#enlist}}, 
which, however, effectively ignores this new information, because it calls 
{{enlisted.computeIfAbsent(tablePartitionId, k -> nodeAndTerm)}}, which means 
that if there has been a previously enlisted transaction (and there was, since 
we are in the process of re-enlisting a transaction), then this new Lease 
information will be ignored and the previous (outdated) information will be 
used instead, thus making this re-trying mechanism completely useless.

> Transaction retry works incorrectly
> -----------------------------------
>
>                 Key: IGNITE-20911
>                 URL: https://issues.apache.org/jira/browse/IGNITE-20911
>             Project: Ignite
>          Issue Type: Bug
>            Reporter: Aleksandr Polovtcev
>            Priority: Critical
>              Labels: ignite-3
>
> Test added in IGNITE-20910 fails with a {{PrimaryReplicaMissException}}. This 
> happens, because after a node has been restarted, its Leases start to expire 
> (which is a separate bug, by the way), which leads to the following chain of 
> events:
> # When a Tuple gets inserted, it ends up in the 
> {{InternalTableImpl#enlistWithRetry}} method;
> # Since the Primary Replica Lease has expired, 
> {{InternalTableImpl#trackingInvoke}} will fail with a 
> {{PrimaryReplicaMissException}}, which means that we should re-enlist the 
> transaction again;
> # When calling {{InternalTableImpl#enlist}} we acquire the new Lease by 
> calling {{placementDriver.awaitPrimaryReplica}};
> # This information is then passed to {{ReadWriteTransactionImpl#enlist}}, 
> which, however, effectively ignores this new information, because it calls 
> {{enlisted.computeIfAbsent(tablePartitionId, k -> nodeAndTerm)}}, which means 
> that if there has been a previously enlisted transaction (and there was, 
> since we are in the process of re-enlisting a transaction), then this new 
> Lease information will be ignored and the previous (outdated) information 
> will be used instead, thus making this re-trying mechanism completely useless.



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

Reply via email to