[
https://issues.apache.org/jira/browse/IGNITE-28202?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Roman Puchkovskiy updated IGNITE-28202:
---------------------------------------
Description:
Some Raft commands do not update last applied index on application. This
results in a gap between last applied index from the point of view of JRaft and
the point of view of the state machine. Here is an example:
# a command with index 15 does not update last applied index in storage, the
storage has index 14, but JRaft thinks that it's 15
# a snapshot is taken on the JRaft node, the storage will persist 14, but log
storage will truncate everything up to (and including) 15, so its first index
will be 16
# a node is restarted, it finds 14 in storage, so its startup snapshot will
think it includes data up to 14, but log storage will think it starts with 16.
JRaft will note the gap and will throw an exception. The node will not be able
to start.
We should do the following:
# Add unit tests making sure that every path of every MS command execution
causes last applied index being advanced
# Add an assertion to verify the invariant
# Fix application of all MS commands
was:
Some Raft commands do not update last applied index on application. This
results in a gap between last applied index from the point of view of JRaft and
the point of view of the state machine. Here is an example:
# a command with index 15 does not update last applied index in storage, the
storage has index 14, but JRaft thinks that it's 15
# a snapshot is taken on the JRaft node, the storage will persist 14, but log
storage will truncate everything up to (and including) 15, so its first index
will be 16
# a node is restarted, it finds 14 in storage, so its startup snapshot will
think it includes data up to 14, but log storage will think it starts with 16.
JRaft will note the gap and will throw an exception. The node will not be able
to start.
> Gap between snapshot and log indexes in Metastorage
> ---------------------------------------------------
>
> Key: IGNITE-28202
> URL: https://issues.apache.org/jira/browse/IGNITE-28202
> Project: Ignite
> Issue Type: Bug
> Components: metastorage ai3
> Reporter: Roman Puchkovskiy
> Assignee: Roman Puchkovskiy
> Priority: Major
> Labels: ignite-3
> Time Spent: 10m
> Remaining Estimate: 0h
>
> Some Raft commands do not update last applied index on application. This
> results in a gap between last applied index from the point of view of JRaft
> and the point of view of the state machine. Here is an example:
> # a command with index 15 does not update last applied index in storage, the
> storage has index 14, but JRaft thinks that it's 15
> # a snapshot is taken on the JRaft node, the storage will persist 14, but
> log storage will truncate everything up to (and including) 15, so its first
> index will be 16
> # a node is restarted, it finds 14 in storage, so its startup snapshot will
> think it includes data up to 14, but log storage will think it starts with
> 16. JRaft will note the gap and will throw an exception. The node will not be
> able to start.
> We should do the following:
> # Add unit tests making sure that every path of every MS command execution
> causes last applied index being advanced
> # Add an assertion to verify the invariant
> # Fix application of all MS commands
--
This message was sent by Atlassian Jira
(v8.20.10#820010)