@Override
    public boolean reset(long nextLogIndex) {
        if (nextLogIndex <= 0) {
            throw new IllegalArgumentException("Invalid next log index.");
        }
        this.writeLock.lock();
        try {
            LogEntry entry = getEntry(nextLogIndex);
            closeDatabase();
            FileUtils.deleteDirectory(new File(this.homePath));
            initAndLoad(null);
            if (entry == null) {
                entry = new LogEntry();
                entry.setType(EntryType.ENTRY_TYPE_NO_OP);
                entry.setId(new LogId(nextLogIndex, 0));
                LOG.warn("Entry not found for nextLogIndex {} when reset.", nextLogIndex);
            }
            return appendEntry(entry);
        } catch (IOException | DatabaseException e) {
            LOG.error("Fail to reset next log index.", e);
        } finally {
            this.writeLock.unlock();
        }
        return false;
    }
First log index and last log index key in configuration column family.
jraft-extension/bdb-log-storage-impl/src/main/java/com/alipay/sofa/jraft/storage/impl/BDBLogStorage.java