code: public void rollbackToPosition(short partition, long seqno) {
      PartitionState ps = partitionStates.get(partition);
      ps.setStartSeqno(seqno);
      ps.setSnapshotStartSeqno(seqno);
      ps.setSnapshotEndSeqno(seqno);
      List<FailoverLogEntry> failoverLog = ps.getFailoverLog();
      Iterator<FailoverLogEntry> flogIterator = failoverLog.iterator();
      List<FailoverLogEntry> entriesToRemove = new ArrayList<>();
      while (flogIterator.hasNext()) {
        FailoverLogEntry entry = flogIterator.next();
        // check if this entry is has a higher seqno than we need to roll back to
        if (lessThanUnsigned(seqno, entry.getSeqno())) {
          entriesToRemove.add(entry);
        }
      }
      failoverLog.removeAll(entriesToRemove);
      partitionStates.set(partition, ps);
    }
docs: Helper method to rollback the given partition to the given sequence number.
  <p>
  This will set the seqno AND REMOVE ALL ENTRIES from the failover log that are higher
  than the given sequence number!
  
  @param partition the partition to rollback
  @param seqno the sequence number where to roll it back to.