You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ratis.apache.org by "Aravindan Vijayan (Jira)" <ji...@apache.org> on 2020/12/02 22:44:00 UTC

[jira] [Created] (RATIS-1195) Log Entry Validation in appendEntry can fail after log purge.

Aravindan Vijayan created RATIS-1195:
----------------------------------------

             Summary: Log Entry Validation in appendEntry can fail after log purge.
                 Key: RATIS-1195
                 URL: https://issues.apache.org/jira/browse/RATIS-1195
             Project: Ratis
          Issue Type: Bug
    Affects Versions: 1.1.0
            Reporter: Aravindan Vijayan
            Assignee: Aravindan Vijayan


After a log purge is done to the last log index, RaftLog#getLastEntryTermIndex will return a null. In RaftLog#validateLogEntry, when the last term index is null, the expectation is that the new entry to be appended is lastSnapshotIndex + 1. However, this 'lastSnapshotIndex' in RaftLog is updated only through installSnapshot calls. Hence, the validation fails and all further appends will fail.

{code}
java.lang.IllegalStateException: Difference between entry index and RaftLog's latest snapshot index -1 is greater than 1 and in between log entries are not present, entry: term: 2
index: 326
stateMachineLogEntry {
  logData: "\b\v\022\000\032\023client-46A48A10F5C6\"\033\n\006hadoop\032\f192.168.48.7\"\003om1Za\n_\n\006hadoop\022\006hadoop\032\004vol3 \377\377\377\377\377\377\377\377\377\0012\017\b\001\022\006hadoop\032\001\200 \0002\016\b\002\022\005users\032\001\200 \0008\215\343\333\251\342.@\000H\000P\215\343\333\251\342.X\377\377\377\377\377\377\377\377\377\001"
  clientId: "\000\f\356MU\026<\331\234;\216\t\352\237\371\027"
  callId: 1
}
{code}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)