[ https://issues.apache.org/jira/browse/IGNITE-25338?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Aleksandr Polovtsev updated IGNITE-25338: ----------------------------------------- Description: Inside OnSpapshotSaveHandler we have the following code: {code:java} return allOf(tableStorageFlushFutures) .thenComposeAsync(v -> { txStatePartitionStorage.snapshotInfo( VersionedSerialization.toBytes(snapshotInfo, PartitionSnapshotInfoSerializer.INSTANCE), lastAppliedIndex, lastAppliedTerm ); {code} This code is called when a snapshot is being saved. Since the code inside `thenComposeAsync` is executed asynchronously, we may update the lastAppliedIndex of the txStatePartitionStorage concurrently with regular writes, because we drop out of the FSM thread. In this case, we don't need to update the lastAppliedIndex together with the snapshot information, they are used in different situations and SnapshotInfo already contains a corresponding last applied index. > OnSnapshotSaveHandler updates Applied Index outside of Raft FSM thread > ---------------------------------------------------------------------- > > Key: IGNITE-25338 > URL: https://issues.apache.org/jira/browse/IGNITE-25338 > Project: Ignite > Issue Type: Bug > Reporter: Aleksandr Polovtsev > Assignee: Aleksandr Polovtsev > Priority: Major > Labels: ignite-3 > Time Spent: 10m > Remaining Estimate: 0h > > Inside OnSpapshotSaveHandler we have the following code: > {code:java} > return allOf(tableStorageFlushFutures) > .thenComposeAsync(v -> { > txStatePartitionStorage.snapshotInfo( > VersionedSerialization.toBytes(snapshotInfo, > PartitionSnapshotInfoSerializer.INSTANCE), > lastAppliedIndex, > lastAppliedTerm > ); > {code} > This code is called when a snapshot is being saved. Since the code inside > `thenComposeAsync` is executed asynchronously, we may update the > lastAppliedIndex of the txStatePartitionStorage concurrently with regular > writes, because we drop out of the FSM thread. In this case, we don't need to > update the lastAppliedIndex together with the snapshot information, they are > used in different situations and SnapshotInfo already contains a > corresponding last applied index. -- This message was sent by Atlassian Jira (v8.20.10#820010)