dant3 commented on code in PR #7694:
URL: https://github.com/apache/ignite-3/pull/7694#discussion_r2924318948
##########
modules/raft/src/main/java/org/apache/ignite/raft/jraft/storage/impl/LogManagerImpl.java:
##########
@@ -1049,11 +1049,25 @@ private boolean reset(final long nextLogIndex) {
}
}
- private void unsafeTruncateSuffix(final long lastIndexKept, final Lock
lock) {
+ /**
+ * Truncates log entries after {@code lastIndexKept}.
+ *
+ * @return {@code true} on success, {@code false} if truncation would
discard applied entries (node moves to error state).
+ */
+ private boolean unsafeTruncateSuffix(final long lastIndexKept, final Lock
lock) {
if (lastIndexKept < this.appliedId.getIndex()) {
- LOG.error("FATAL ERROR: Can't truncate logs before appliedId={},
lastIndexKept={}", this.appliedId,
- lastIndexKept);
- return;
+ LOG.error("Raft log suffix conflict: cannot truncate entries that
have been applied to the state machine. "
Review Comment:
Done!
--
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]