[
https://issues.apache.org/jira/browse/IGNITE-27197?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Filipp Shergalis updated IGNITE-27197:
--------------------------------------
Summary: Sending raft entries with truncated log and no new commands is
broken (was: Streaming raft snapshot with truncated log and no new commands is
broken)
> Sending raft entries with truncated log and no new commands is broken
> ---------------------------------------------------------------------
>
> Key: IGNITE-27197
> URL: https://issues.apache.org/jira/browse/IGNITE-27197
> Project: Ignite
> Issue Type: Improvement
> Reporter: Filipp Shergalis
> Assignee: Filipp Shergalis
> Priority: Major
> Labels: ignite-3
>
> Replicator.sendEntries doesn't handle snapshots if log was truncated and no
> new commands applied to log afterwards.
>
> Looks like in fillCommonFields we need to take term from the snapshot meta
> (if exists) if
> prev_log_index was compacted
>
> Reproducer. 1 initial node, taking "forced" raft snapshot (to truncate log),
> shut down cluster immediately, start cluster with 2 nodes. Streaming snapshot
> fails with "
> snapshot is not newer"
> @Test
> void testMetastorageSnapshots(TestInfo testInfo) \{
> truncateRaftLog();
> cluster.shutdown();
> ClusterConfiguration.Builder clusterConfiguration =
> ClusterConfiguration.builder(testInfo, workDir)
>
> .defaultNodeBootstrapConfigTemplate(getNodeBootstrapConfigTemplate());
> customizeConfiguration(clusterConfiguration);
> cluster = new Cluster(clusterConfiguration.build());
> cluster.startAndInit(testInfo, 2, new int[]{0},
> this::customizeInitParameters);
> }
> private void truncateRaftLog() \{
> IgniteImpl igniteImpl = unwrapIgniteImpl(node(0));
> SnapshotRequest request = new RaftMessagesFactory().snapshotRequest()
> .groupId(MetastorageGroupId.INSTANCE.toString())
> .peerId(igniteImpl.name())
> .forced(true)
> .build();
> MessagingService messagingService =
> igniteImpl.raftManager().messagingService();
> messagingService.invoke(igniteImpl.name(), request, 10_000L)
> .thenApply(ignored -> null)
> .join();
> }
--
This message was sent by Atlassian Jira
(v8.20.10#820010)