@Override
    protected void onShutdown() {
        stopCheckpointTask();
        stopSegmentAllocator();

        List<SegmentFile> shutdownFiles = Collections.emptyList();
        this.writeLock.lock();
        try {
            doCheckpoint();
            shutdownFiles = new ArrayList<>(this.segments);
            this.segments.clear();
            if (!this.abortFile.destroy()) {
                LOG.error("Fail to delete abort file {}.", this.abortFile.getPath());
            }
        } finally {
            this.writeLock.unlock();
            for (final SegmentFile segmentFile : shutdownFiles) {
                segmentFile.shutdown();
            }
            shutdownBlankSegments();
        }
        this.writeExecutor.shutdown();
    }
It's wrote position is from start(HEADER_SIZE) but it's not the last file, SHOULD not happen.
jraft-core/src/main/java/com/alipay/sofa/jraft/storage/log/RocksDBSegmentLogStorage.java