private Optional<SnapshotFile> deleteSnapshot(long snapshotOffset) {
        SnapshotFile snapshotFile = snapshots.remove(snapshotOffset);
        snapshotsMap.remove(snapshotOffset);
        return Optional.ofNullable(snapshotFile);
    }
Only keep the last snapshot which offset less than or equals to the recoveryPointCheckpoint
core/src/main/scala/kafka/log/streamaspect/ElasticProducerStateManager.java