Hi, I'm reading flink runtime source code recently, and I found that when create DispatcherResourceManagerComponent in {@link org.apache.flink.runtime.entrypoint.component.DefaultDispatcherResourceManagerComponentFactory#create}, it will start DispatcherLeaderRetrieverService and ResourceManagerLeaderRetrieverService which is in order to watch the leader address change. And my question is - as this piece of code is part of jobmanager starting process which is meant to be the leader, then why does it watch the leader itself?
dispatcherLeaderRetrievalService = highAvailabilityServices.getDispatcherLeaderRetriever(); resourceManagerRetrievalService = highAvailabilityServices.getResourceManagerLeaderRetriever(); Thank