You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ignite.apache.org by "Mirza Aliev (Jira)" <ji...@apache.org> on 2021/09/30 15:37:00 UTC

[jira] [Comment Edited] (IGNITE-15222) Metastorage's cursor commands next and hasNext must work correctly after Raft leader was changing.

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

Mirza Aliev edited comment on IGNITE-15222 at 9/30/21, 3:36 PM:
----------------------------------------------------------------

Hello folks, seems that main branch is way ahead of the current branch and thre are a lot of conflicts, I'll update it and turn back


was (Author: maliev):
Hello folks, seems that main branch is way ahead of the current branch, I'll update it and turn back

> Metastorage's cursor commands next and hasNext must work correctly after Raft leader was changing.
> --------------------------------------------------------------------------------------------------
>
>                 Key: IGNITE-15222
>                 URL: https://issues.apache.org/jira/browse/IGNITE-15222
>             Project: Ignite
>          Issue Type: Bug
>            Reporter: Mirza Aliev
>            Assignee: Mirza Aliev
>            Priority: Major
>              Labels: ignite-3
>             Fix For: 3.0.0-alpha3
>
>
> Metastorage's cursor commands next and hasNext are implemented using {{CursorNextCommand}} and {{CursorHasNextCommand}} Raft commands, which are Raft's Read Commands. Read commands are handled on Raft leader and don't replicate to followers. Within the context of cursors, it means that cursor position, which is moved by the next command, is stored on leader only and might be lost on leader change. It will lead to unexpected side effects on the raft client because from the client's point of view, the leader migration is seamless and should be invisible. In other words, calling next on leader A will only move cursor position on this particular raft node, so that after leader migration, the client's next {{next()}} command will be processed on a new leader B and will move cursor position again to the same step. 
> A possible solution is to change {{CursorNextCommand}} and {{CursorHasNextCommand}} to raft's write commands, so they will be replicated on the followers and new followers will handle the commands correctly.
> UPD: 
>  {{CursorNextCommand}} and {{CursorHasNextCommand}} are already raft's write commands, so this task contains only test 



--
This message was sent by Atlassian Jira
(v8.3.4#803005)