cancel
Showing results for 
Search instead for 
Did you mean: 

Can sp_stop_listener() be used to simulate a HA failover?

VolkerBarth
Contributor
2,035

v17 has introduced a facility to start and stop TCP/IP and HTTP(S) listeners on a running database server w.t.h. of the new sp_start_listener and sp_stop_listener system procedures.

For am moment, I thought they could also be used to simulate dropped/re-established connections in a HA demo setup. However, that does not work as expected.

Am I right that this is doomed to fail (once the initial mirror connections have been established) because stopping the listeners does only affect new connections and not those already existing mirror connections? (And it will also create problems when the listeners for the primary server are stopped, thus preventing new connections to that server although the HA system still treats that server as primary because the internal mirror connections are functional?)


FWIW: Stopping all listeners and then dropping the current connection allows also for a nice catch-22 experience...

Accepted Solutions (1)

Accepted Solutions (1)

Former Member

Listeners are only used to accept new connections. Existing connections live on until they die or disconnected. {see the "Remarks" section for sp_stop_listener}

You could consider stopping the listener and forcing disconnects on any other existing connections if that fits your requirements.

Answers (0)