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

Alexander Lapin resolved IGNITE-17261.
--------------------------------------
    Resolution: Duplicate

> Implement a coordinator path write intent resolution logic for RO reads
> -----------------------------------------------------------------------
>
>                 Key: IGNITE-17261
>                 URL: https://issues.apache.org/jira/browse/IGNITE-17261
>             Project: Ignite
>          Issue Type: Improvement
>            Reporter: Alexander Lapin
>            Priority: Major
>              Labels: ignite-3, transaction3_ro
>         Attachments: Screenshot from 2022-07-06 17-00-26.png
>
>
> Because of lock-free nature, RO reads might interact with writeIntents, 
> meaning that such intents should be either evaluated as committed, aborted or 
> pending. In order to perform writeIntent resolution it's required to
>  * If PartitionReplicaListener read a write intent then it checks a local txn 
> state map for committed or aborted state - allow read if the state is 
> committed and commitTs <= readTs.
>  * If not possible, PartitionReplicaListener send TxStateReq to coordinator 
> by ReplicaService. - this initiates the {*}coordinator path{*}. Coordinator 
> address is fetched from the [txn state 
> map|https://docs.google.com/document/d/1PndaylEfK7CPUN7Kv9RYPKASN299s2qlbnMA5xIOFXo/edit#heading=h.wx3zf7jlf156].
>  * If a coordinator path was not able to resolve the intent, one of the 
> following has happened - the coordinator is dead or txn state is not 
> available in the cache. Calculate a commit partition and send the TxStateReq 
> to its primary replica - this initiates the {*}commit partition path{*}.
>  * Retry commit partition path until a success or timeout.
> On receiving TxStateReq in ReplicaManager on the coordinator:
>  * ReplicaManager reads txn state map. If the local txn is finished, return 
> the response with the outcome: commit or abort. The txn state is stored in a 
> local cache (https://issues.apache.org/jira/browse/IGNITE-17638)
>  * If the local txn is finishing (txState == Finishing) waiting for finish 
> state replication, wait with timeout for outcome and return response with the 
> outcome: commit or abort. txState become Finishing in TxManager on creating 
> TxFinishReplicaRequest. TxManager has a txn state map. We can use future for 
> concurrency and atomic operations on txn state map.
>  * If the outcome is commit, additional timestamp check is required: a commit 
> timestamp must be <= readTs. If the condition is not held, the outcome is 
> changed to abort.
>  * If local txn is active (txState != [finishing, commit, abort]), adjust the 
> txn coordinator node HLC according to readTs to make sure the txn commit 
> timestamp is above the read timestamp. The read timestamp must be installed 
> before txn is started to commit, so commit timestamp is assigned after the 
> read timestamp.
>  * If txn state is not found in a local cache and txn is not active, return 
> NULL.
>  
> There's an open question about MvPartitionStorage api feature: 
> https://issues.apache.org/jira/browse/IGNITE-17627



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

Reply via email to