static void checkIfActiveHasChanged(Session session, Session activeSession, boolean ignoreStaleSessionFailure) {
        long activeSessionAtCreate = session.getActiveSessionAtCreate();
        log.log(Level.FINE, () -> activeSession.logPre() + "active session id at create time=" + activeSessionAtCreate);
        if (activeSessionAtCreate == 0) return; // No active session at create time, or session created for indeterminate app.

        long sessionId = session.getSessionId();
        long activeSessionSessionId = activeSession.getSessionId();
        log.log(Level.FINE, () -> activeSession.logPre() + "sessionId=" + sessionId +
                            ", current active session=" + activeSessionSessionId);
        if (activeSession.isNewerThan(activeSessionAtCreate) &&
            activeSessionSessionId != sessionId) {
            String errMsg = activeSession.logPre() + "Cannot activate session " + sessionId +
                            " because the currently active session (" + activeSessionSessionId +
                            ") has changed since session " + sessionId + " was created (was " +
                            activeSessionAtCreate + " at creation time)";
            if (ignoreStaleSessionFailure) {
                log.warning(errMsg + " (Continuing because of force.)");
            } else {
                throw new ActivationConflictException(errMsg);
            }
        }
    }
Creates a new deployment from the active application, if available.
This is used for system internal redeployments, not on application package changes.

@param application the active application to be redeployed
@param timeout the timeout to use for each individual deployment operation
@param bootstrap the deployment is done when bootstrapping
@return a new deployment from the local active, or empty if a local active application
        was not present for this id (meaning it either is not active or active on another
        node in the config server cluster)
configserver/src/main/java/com/yahoo/vespa/config/server/ApplicationRepository.java