Uploaded image for project: 'Ratis'
  1. Ratis
  2. RATIS-1195

Log Entry Validation in appendEntry can fail after log purge.

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • None
    • 2.0.0
    • server
    • None

    Description

      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, the 'lastSnapshotIndex' in RaftLog is updated only through installSnapshot calls. Hence, the validation fails and all further appends will fail until a restart.

      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
      }
      

      cc hanishakoneru / msingh

      Attachments

        Issue Links

          Activity

            People

              avijayan Aravindan Vijayan
              avijayan Aravindan Vijayan
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 1h 20m
                  1h 20m