[
https://issues.apache.org/jira/browse/IGNITE-21000?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17795226#comment-17795226
]
Alexander Lapin commented on IGNITE-21000:
------------------------------------------
Proposed solution is inorrect. Seem that we have serious issue in jraft itself,
so I've asked the jraft guys https://github.com/sofastack/sofa-jraft/issues/1049
> ItDistributedConfigurationStorageTest#testRestartWithPds may fail
> -----------------------------------------------------------------
>
> Key: IGNITE-21000
> URL: https://issues.apache.org/jira/browse/IGNITE-21000
> Project: Ignite
> Issue Type: Bug
> Reporter: Alexander Lapin
> Assignee: Alexander Lapin
> Priority: Blocker
> Labels: ignite-3
> Time Spent: 10m
> Remaining Estimate: 0h
>
> {code:java}
> java.lang.AssertionError:
> Expected: is <{foo=bar}>
> but: was <{}>java.lang.AssertionError:Expected: is <{foo=bar}> but:
> was <{}> at org.hamcrest.MatcherAssert.assertThat(MatcherAssert.java:20) at
> org.hamcrest.MatcherAssert.assertThat(MatcherAssert.java:6) at
> org.apache.ignite.internal.configuration.storage.ItDistributedConfigurationStorageTest.testRestartWithPds(ItDistributedConfigurationStorageTest.java:256)
> at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native
> Method) {code}
> [https://ci.ignite.apache.org/buildConfiguration/ApacheIgnite3xGradle_Test_RunAllTests/7665195?expandCode+Inspection=true&expandBuildProblemsSection=true&hideProblemsFromDependencies=false&expandBuildTestsSection=true&hideTestsFromDependencies=false]
>
> The reason of the failure is possible read/write commands reordering on raft
> node restart. GetCurrentRevisionCommand (extends ReadCommand) handling checks
> whether raft index matches storage one and if it does - evaluates the read.
> After IGNITE-20425 raft log application is done asynchronously, meaning that
> if GetCurrentRevisionCommand will touch the leader after election but prior
> to log replay it will see 0 both in raft and storage indexes instead of 1 and
> (0 or 1) respectively. In order to fix this it's possible to add
> lastCommittedIndex initialization:
> {code:java}
> public boolean resetPendingIndex(final long newPendingIndex) {
> ...
> this.lastCommittedIndex = newPendingIndex - 1;
> ...
> }{code}
> Given solution was disccused previoulsy, see
> [https://github.com/apache/ignite-3/pull/960/files#diff-f3783b069060b4e1616ce9675b7a120ebf9797b4439ff6bae43376af62df0200]
> for more details.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)