You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ignite.apache.org by "Vyacheslav Koptilin (Jira)" <ji...@apache.org> on 2021/11/24 20:23:00 UTC

[jira] [Updated] (IGNITE-15222) Add test for Metastorage's cursor commands next and hasNext correctly working after Raft leader was changing.

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

Vyacheslav Koptilin updated IGNITE-15222:
-----------------------------------------
    Reviewer: Vyacheslav Koptilin

> Add test for Metastorage's cursor commands next and hasNext correctly working 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
>
> 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.20.1#820001)