Sessions in clickhouse-keeper are local entity for each quorum participant but some information about session are global for the state of keeper: session_ids and corresponding ephemeral nodes. It make sense to send close requests to RAFT during server shutdown so all connected sessions will be closed properly and corresponding ephemeral nodes will be removed from state.

snapshots_queue.finish();
            if (snapshot_thread.joinable())
                snapshot_thread.join();
            update_configuration_queue.finish();
            if (update_configuration_thread.joinable())
                update_configuration_thread.join();
        }
        if (server)
            server->shutdown();
        KeeperStorage::RequestForSession request_for_session;
        
        while (requests_queue && requests_queue->tryPop(request_for_session))
        {
            CurrentMetrics::sub(CurrentMetrics::KeeperOutstandingRequets);
            auto response = request_for_session.request->makeResponse();
            response->error = Coordination::Error::ZSESSIONEXPIRED;
            setResponse(request_for_session.session_id, response);
        }
        
        std::lock_guard lock(session_to_response_callback_mutex);
        session_to_response_callback.clear();
        CurrentMetrics::set(CurrentMetrics::KeeperAliveConnections, 0);
    }
    catch (...)
    {
        tryLogCurrentException(__PRETTY_FUNCTION__);
    }
    LOG_DEBUG(log, "Dispatcher shut down");
}
void KeeperDispatcher::forceRecovery()