You can specify a preferred master by adding it as the first hostname in the agent's pm.settings 'masters' list and changing the 'SelectHostRandom' setting to 'NO'. E.G.
SelectHostRandom NO
masters preferred_master, alternate_master
The agent will then always try to contact the preferred master first, and will only go to the alternate_master if it does not get a response from the preferred_master withing the FailOverTimeOut period.