alievmirza commented on code in PR #937:
URL: https://github.com/apache/ignite-3/pull/937#discussion_r921084903


##########
modules/raft/src/main/java/org/apache/ignite/raft/jraft/core/NodeImpl.java:
##########
@@ -973,7 +973,11 @@ public boolean init(final NodeOptions opts) {
             LOG.error("Node {} initMetaStorage failed.", getNodeId());
             return false;
         }
-        if (!initFSMCaller(new LogId(0, 0))) {
+
+        long lastAppliedIndex = opts.getLastAppliedIndex();
+        long persistedTerm = metaStorage.getTerm();
+
+        if (!initFSMCaller(new LogId(lastAppliedIndex, persistedTerm))) {

Review Comment:
   This is dangerous to set term higher than 0 or 1 to a new raft node, this 
may cause inconsistencies to the raft protocol. I highly recommend to use 
`org.apache.ignite.raft.jraft.core.NodeImpl#bootstrap`, where guaranties for a 
new bootstrapped node are checked. 



-- 
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