private void verifyVersionIntervalForUpgrade(Version storedVersion) {
        int storedVersionMajor = storedVersion.getMajor();
        int storedVersionMinor = storedVersion.getMinor();
        int currentVersionMajor = currentVersion.getMajor();
        int currentVersionMinor = currentVersion.getMinor();
        boolean sameMajor = storedVersionMajor == currentVersionMajor;
        boolean differentMajor = !sameMajor;

        String message = "Cannot upgrade from " + storedVersion + " to " + currentVersion();
        if (storedVersionMajor < latestVersionOnPreviousMajor.getMajor())
            logOrThrow(message + " (upgrade across 2 major versions not supported). Please upgrade to " +
                               latestVersionOnPreviousMajor.toFullString() + " first." +
                               " Setting VESPA_SKIP_UPGRADE_CHECK=true will skip this check at your own risk," +
                               " see https://vespa.ai/releases.html#versions");
        else if (sameMajor && (currentVersionMinor - storedVersionMinor > allowedMinorVersionInterval))
            logOrThrow(message + ". Please upgrade to an older version first, the interval between the two versions is too large (> " + allowedMinorVersionInterval + " releases)." +
                               " Setting VESPA_SKIP_UPGRADE_CHECK=true will skip this check at your own risk," +
                               " see https://vespa.ai/releases.html#versions");
        else if (differentMajor && storedVersionMinor < latestVersionOnPreviousMajor.getMinor())
            logOrThrow(message + " (new major version). Please upgrade to " + latestVersionOnPreviousMajor.toFullString() + " first." +
                               " Setting VESPA_SKIP_UPGRADE_CHECK=true will skip this check at your own risk," +
                               " see https://vespa.ai/releases.html#versions");
        else if (differentMajor && currentVersionMinor > allowedMinorVersionInterval)
            logOrThrow(message + ". Please upgrade to an older version first, the interval between the two versions is too large (> " + allowedMinorVersionInterval + " releases)." +
                               " Setting VESPA_SKIP_UPGRADE_CHECK=true will skip this check at your own risk," +
                               " see https://vespa.ai/releases.html#versions");
    }
Contains version information for this configserver. Stored both in file system and in ZooKeeper (uses
data in ZooKeeper if distributeApplicationPackage and data found in ZooKeeper)

@author Ulf Lilleengen
@author hmusum
configserver/src/main/java/com/yahoo/vespa/config/server/version/VersionState.java