The rules by which the server is determined encompass:
• The prioritized list of servers specified in the application's configuration;
• Whether or not a service instance is synchronized;
• The Alternate status of a service instance (see Alternate Status); and
• The Sticky status of a service instance (see Sticky Status).
Note that, in the server evaluation rules that follow, the phrase "available service instance" means that a service instance has been registered and synchronized (if necessary).
1. When a service registers with the RPC Manager, it defaults to having its Alternate status clear. The prioritized list of severs is read from the application's configuration.
2. If a service instance sets itself into Alternate status, the next available service instance on the prioritized list that is not Alternate is selected as the server for that service.
3. If all the service instances are in Alternate status, they are all forced out of Alternate status, except the service instance that was the most recent server; this instance remains in Alternate status. The highest priority available service instance is selected as the server.
4. If a service instance clears its Alternate status (or has it forcibly cleared as indicated in rule 3 above), then it is selected as the server only if there are no higher priority service instances available.
5. If there are no available service instances, the highest priority registered, but not synchronized, service instance is selected as the server.
6. If the selected server is not the current server and the current server is not a "sticky" server, the current server is demoted from server status.
7. The selected server is promoted to be the current server.
8. If there is only one server on the prioritized list for the service, neither Alternate status nor Sticky status has any effect.