You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ignite.apache.org by "Semyon Danilov (Jira)" <ji...@apache.org> on 2022/09/22 18:33:00 UTC

[jira] [Comment Edited] (IGNITE-17720) Extend MvPartitionStorage scan API with write intent resolution capabilities

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

Semyon Danilov edited comment on IGNITE-17720 at 9/22/22 6:32 PM:
------------------------------------------------------------------

[~ibessonov] [~Sergey Uttsel]

I propose the following API:


{code:java}
public interface PartitionCursorWithTimestamp extends Cursor<ReadResult> {

    BinaryRow committed(HybridTimestamp timestamp);

}
{code}

So basically, when you iterate it should be something like this:

{code:java}
while (cursor.hasNext()) {
    ReadResult res = cursor.next();
     
    if (res.isWriteIntent()) {
         // For example, we don't want write intent here
         BinaryRow row = cursor.committed(res.newestCommitTimestamp());

         foo(row);

         continue;
    }
    
    foo(res.binaryRow());
}
{code}


was (Author: sdanilov):
[~ibessonov] [~Sergey Uttsel]

I propose the following API:

```
public interface PartitionCursorWithTimestamp extends Cursor<ReadResult> {

    BinaryRow committed(HybridTimestamp timestamp);

}
```

So basically, when you iterate it should be something like this:
```
while (cursor.hasNext()) {
    ReadResult res = cursor.next();
     
    if (res.isWriteIntent()) {
         // For example, we don't want write intent here
         BinaryRow row = cursor.committed(res.newestCommitTimestamp());

         foo(row);

         continue;
    }
    
    foo(res.binaryRow());
}
```

> Extend MvPartitionStorage scan API with write intent resolution capabilities
> ----------------------------------------------------------------------------
>
>                 Key: IGNITE-17720
>                 URL: https://issues.apache.org/jira/browse/IGNITE-17720
>             Project: Ignite
>          Issue Type: Bug
>            Reporter: Semyon Danilov
>            Priority: Major
>              Labels: ignite-3
>
> Commit of RW transaction is not instantaneous. RO transaction might require reads of data that's in the process of being committed. Current API doesn't support such scenario.
> RO API in partition storage has only two methods: read and scan.
> For read see https://issues.apache.org/jira/browse/IGNITE-17627
> h3. Scan
> This one is tricky, we can't just return a cursor. Special type of cursor is required, and it must allow same read capabilities on each individual element.
> API is to be defined.



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