rpuch commented on code in PR #5083:
URL: https://github.com/apache/ignite-3/pull/5083#discussion_r1939129472


##########
modules/raft/src/integrationTest/java/org/apache/ignite/raft/jraft/core/ItNodeTest.java:
##########
@@ -3506,6 +3507,102 @@ public void 
onRawConfigurationCommitted(ConfigurationEntry conf) {
         );
     }
 
+    @Test
+    public void testIndexAndTermOfCfgArePropagatedToSnapshotMeta() throws 
Exception {
+        TestPeer peer0 = new TestPeer(testInfo, TestUtils.INIT_PORT);
+
+        AtomicLong term = new AtomicLong(-1);
+        AtomicLong index = new AtomicLong(-1);
+
+        AtomicLong metaTerm = new AtomicLong(-1);
+        AtomicLong metaIndex = new AtomicLong(-1);
+
+        cluster = new TestCluster(
+                "testIndexAndTermOfCfgArePropagatedToSnapshotMeta",
+                dataPath,
+                Collections.singletonList(peer0),
+                new LinkedHashSet<>(),
+                ELECTION_TIMEOUT_MILLIS,
+                (peerId, opts) -> {
+                    opts.setFsm(new MockStateMachine(peerId) {
+                        @Override
+                        public boolean onSnapshotLoad(SnapshotReader reader) {
+                            SnapshotMeta meta = reader.load();
+
+                            metaTerm.set(meta.cfgTerm());
+                            metaIndex.set(meta.cfgIndex());

Review Comment:
   My suggestion is to make this (that just one node can change index and term) 
obvious. An `if` that I proposed in the first comment would solve this. Another 
option is to add a comment, for example



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to