[ 
https://issues.apache.org/jira/browse/IGNITE-19570?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17758411#comment-17758411
 ] 

Alexander Lapin commented on IGNITE-19570:
------------------------------------------

[~v.pyatkov] LGTM

> Write intent resolution for RW transactions
> -------------------------------------------
>
>                 Key: IGNITE-19570
>                 URL: https://issues.apache.org/jira/browse/IGNITE-19570
>             Project: Ignite
>          Issue Type: Improvement
>            Reporter: Vladislav Pyatkov
>            Assignee: Vladislav Pyatkov
>            Priority: Major
>              Labels: ignite-3, transaction, transaction3_recovery
>             Fix For: 3.0.0-beta2
>
>          Time Spent: 8h 10m
>  Remaining Estimate: 0h
>
> *Motivation*
> Currently, RW transaction resolves only write intents by itself. If RW 
> transaction steps on a write intent from another transaction, an assertion 
> error will appear.
> {code:java}
>       // Should never happen, currently, locks prevent reading another 
> transaction intents during RW requests.
>     throw new AssertionError("Mismatched transaction id, expectedTxId={" + 
> txId + "},"
>             + " actualTxId={" + retrievedResultTxId + '}');
> {code}
> Really, we will be able to leave write intent in case when node restarted 
> before it can handle cleanup message. Now, we workaround the case by scanning 
> storage for logging for write intent and commit them on start:
> {code:java}
>         try (PartitionTimestampCursor cursor = 
> partitionDataStorage.scan(HybridTimestamp.MAX_VALUE)) {
>             while (cursor.hasNext()) {
>                 ReadResult readResult = cursor.next();
>                 if (readResult.isWriteIntent()) {
>                     
> txsPendingRowIds.computeIfAbsent(readResult.transactionId(), key -> new 
> TreeSet<>()).add(readResult.rowId());
>                 }
>             }
>         }
> {code}
> But this is very time-consuming.



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

Reply via email to