Open formicas opened 6 years ago
There are a few TDS_MSG
types, prefixed with TDS_MSG_MIG_
, which appear to be related to failover.
In the normal case:
TDS_MSG_MIG_REQ
) to a different server (address gets provided as another token).TDS_MSG_MIG_SYNC
)TDS_MSG_MIG_CONT
) or cancel migration (TDS_MSG_MIG_IGN
).TDS_MSG_MIG_FAIL
).In the normal case, it sounds like the Primary will send data to the client until it's time to migrate, and then the client will receive the rest of the data from the new server.
I'm not sure what behaviour should be in other circumstances, not sure when AseFailoverException
comes into it.
Will have an HADR environment to test against available from 14th-18th January so we can suss this out. The AseFailoverException
could just be some legacy thing from a previous failover mechanism maybe just associated with the HASession
, AlternateServers
, Secondary Data Source
, and Secondary Server Port
connection string properties.
Connection failover enhancement Existing connection failover allows a client application to switch to an alternate ASE server if the primary server becomes unavailable due to an unplanned event, like power outage or a socket failure. This feature is enhanced to allow client applications to failover numerous times to multiple servers using dynamic failover addresses.
With the High Availability enabled, the client application does not need to be configured to know the possible failover targets. ASE keeps the client updated with the best failover list based on cluster membership, logical cluster usage and load distribution. During failover, the client refers to the ordered failover list while attempting to reconnect. If the driver successfully connects to a server, the driver internally updates the list of host values based on the list returned. Otherwise, the driver throws a connection failure exception.
Enabling extended connection failover in ADO.NET To enable the extended failover, you need to set the HASession connection string property to 1. For example:
Data Source=server1;Port=port1;User ID=sa;Password=; Initial Catalog=sdc;HASession=1; AlternateServers=server2:port2,...,serverN:portN;
In the preceding example, Data Source defines the primary server and port. ADO.NET Provider by Sybase will try to establish connection to the primary server first and, if unsuccessful, will go through the servers listed in Alternate Servers until a connection is established or until the end of the list is reached.
Note - The list of alternate servers specified in the connection string is used only during initial connection. After the connection is established with any available instance, and the client supports high-availability, the client will receive an updated list of the best possible failover targets from the server. This new list overrides the specified list.
Not necessarily a priority for us, but it sounds like the mechanic of getting the list of other servers in the response from the logon server is the same in this model as it is in the HA/DR one, so maybe we can support both at the same time...
From https://www.connectionstrings.com/ase-ado-net-data-provider/ We need to support the following parameters:
HASession
- when set to1
this means we need to operate in a mode which supports failover - I'll call this "HA mode"AlternateServers
- a comma-separated list of alternative servers to connect when opening a connectionserver:port[,server:port/*...*/,server:port]
Secondary Data Source
+Secondary Server Port
- alternate way to specify an alternative serverAlso, it sounds like once the client establishes a connection with one of the servers specified, the client will receive a list of all available failover targets (servers).
Planned behaviour (still being thought about. not final):
Open
behaviour to fall back to the alternate servers