public Pair<IndexEntry, IndexEntry> lookupLastLogIndexAndPosFromTail() {
        final long lastLogIndex = getLastLogIndex();
        final long firstLogIndex = getFirstLogIndex();
        IndexEntry lastSegmentIndex = null, lastConfIndex = null;
        long index = lastLogIndex;
        while (index >= firstLogIndex) {
            final IndexEntry indexEntry = lookupIndex(index);
            indexEntry.setLogIndex(index);
            if (indexEntry.getLogType() == IndexType.IndexSegment.getType() && lastSegmentIndex == null) {
                lastSegmentIndex = indexEntry;
            } else if (indexEntry.getLogType() == IndexType.IndexConf.getType() && lastConfIndex == null) {
                lastConfIndex = indexEntry;
            }
            if (lastSegmentIndex != null && lastConfIndex != null) {
                break;
            }
            index--;
        }
        return Pair.of(lastSegmentIndex, lastConfIndex);
    }
Search the last segment log index and last conf log index from tail
@return pair of IndexEntry<last log index and position> (segment / conf)
jraft-extension/java-log-storage-impl/src/main/java/com/alipay/sofa/jraft/storage/db/IndexDB.java