dant3 commented on code in PR #7694:
URL: https://github.com/apache/ignite-3/pull/7694#discussion_r3021262355


##########
modules/raft/src/main/java/org/apache/ignite/raft/jraft/core/NodeImpl.java:
##########
@@ -1066,6 +1066,19 @@ public boolean init(final NodeOptions opts) {
             return false;
         }
 
+        // Restore appliedId so that unsafeTruncateSuffix() can reject 
truncation of applied entries.

Review Comment:
   This block restores appliedId from the state machine's persisted applied 
index so the guard is effective immediately after restart, before any entries 
are re-applied.
   After a node restart, logManager.appliedId is transient and resets to 0. The 
unsafeTruncateSuffix() guard checks lastIndexKept < appliedId.getIndex() — but 
with appliedId=0, it can never reject anything. This effectively leads to 
possible data corruption.



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