private boolean processCorruptedHeaderFiles(final List<File> corruptedHeaderSegments) throws IOException {
        if (corruptedHeaderSegments.size() == 1) {
            final File corruptedFile = corruptedHeaderSegments.get(0);
            if (getFileSequenceFromFileName(corruptedFile) != this.nextFileSequence.get() - 1) {
                LOG.error("Detected corrupted header segment file {}.", corruptedFile);
                return false;
            } else {
                // The file is the last file,it's the new blank segment but fail to save header, we can
                // remove it safely.
                LOG.warn("Truncate the last segment file {} which it's header is corrupted.",
                    corruptedFile.getAbsolutePath());
                // We don't want to delete it, but rename it for safety.
                FileUtils.moveFile(corruptedFile, new File(corruptedFile.getAbsolutePath() + ".corrupted"));
            }
        } else if (corruptedHeaderSegments.size() > 1) {
            // FATAL: it should not happen.
            LOG.error("Detected corrupted header segment files: {}.", corruptedHeaderSegments);
            return false;
        }

        return true;
    }
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