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

Kirill Tkalenko commented on IGNITE-20419:
------------------------------------------

Looks good.

> Raft "snapshots" are broken in aipersist
> ----------------------------------------
>
>                 Key: IGNITE-20419
>                 URL: https://issues.apache.org/jira/browse/IGNITE-20419
>             Project: Ignite
>          Issue Type: Bug
>            Reporter: Ivan Bessonov
>            Assignee: Ivan Bessonov
>            Priority: Major
>              Labels: ignite-3
>             Fix For: 3.0.0-beta2
>
>          Time Spent: 1h 40m
>  Remaining Estimate: 0h
>
> This code:
> {code:java}
> storage.runConsistently(locker -> {
>     storage.lastApplied(maxLastAppliedIndex, maxLastAppliedTerm);
>     return null;
> }); {code}
> Here we don't touch any pages. As a result, updated index value may not be 
> persisted to the storage in the next checkpoint. This causes eventual 
> exception on restart:
> {noformat}
> java.lang.IllegalArgumentException: Try to truncate logs before 336, but the 
> firstLogIndex is 370
>       at 
> org.apache.ignite.raft.jraft.util.Requires.requireTrue(Requires.java:92) 
> ~[main/:?]
>       at 
> org.apache.ignite.raft.jraft.storage.impl.LogManagerImpl.truncatePrefix(LogManagerImpl.java:997)
>  ~[main/:?]
>       at 
> org.apache.ignite.raft.jraft.storage.impl.LogManagerImpl.setSnapshot(LogManagerImpl.java:654)
>  ~[main/:?]
> ...{noformat}
> In checkpointer, we must check for changed meta as well.
> Everything here can be tested with unit tests.



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

Reply via email to