[ https://issues.apache.org/jira/browse/IGNITE-15222?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17451795#comment-17451795 ]
Mirza Aliev commented on IGNITE-15222: -------------------------------------- Hello, PR is ready for reviewing. > 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)