The Impact of a Stale Failover Partner Name
The database administrator can change the failover partner at any time. Therefore, a client-supplied failover partner name might be out of date, or stale. For example, consider a failover partner named Partner_B that is replaced by another server instance, Partner_C. Now, if a client supplies Partner_B as the failover partner name, that name is stale. When the client-supplied failover partner name is stale, the behavior of the data access provider equates to the case in which a failover partner name is not supplied by the client.
For example, consider situation in which a client uses one connection string for a series of four connection attempts. In the connection string, the initial partner name is Partner_A, and the failover partner name is Partner_B:
"Server=Partner_A; Failover Partner=Partner_B; Database=AdventureWorks2008R2"
The following table shows four partner configurations and indicates for each whether this connection string works for connecting the client for the first time.
An application can track configuration changes and change its connection string accordingly. This requires extra code but reduces the administrative burden.
Behavior when attempting to connect specifying Partner_A and Partner_B
Original mirroring configuration.
Partner_A is cached as the initial partner name. The client succeeds in connecting to Partner_A. The client downloads the name of mirror server, Partner_B, and caches it, ignoring the client-supplied failover partner name.
Partner_A experiences a hardware failure, and failover occurs (disconnecting clients).
The Partner_A is still cached as the initial partner name, but the client-supplied failover partner name, Partner_B, permits the client to connect to the current principal server.
The database administrator stops mirroring (disconnecting clients), replaces Partner_A with Partner_C, and restarts mirroring.
The client attempts to connect to Partner_A and fails; then the client tries Partner_B (the current principal server) and succeeds. The data access provider downloads the name of the current mirror server, Partner_C, and caches it as the current failover partner name.
Service is manually failed over to Partner_C (disconnecting clients).
Client attempts to connect to Partner_A initially, and then to Partner_B. Both names fail, and eventually the connection request times out and fails.