[DEV-454] Fix bug with avoiding the last server on a retry