Written by

Question Dan Pahnke · Mar 31, 2020

Force a failover on a mirror?

Is there a way to force a failover from the primary mirror member to the backup member without forcing down the primary (which happens with ##class(SYS.Mirror).BecomePrimary())? What I'm trying to simulate is a network isolated condition on the primary.

Comments

Vic Sun · Mar 31, 2020

Hello Dan,

I am struggling to understand the scenario that you are testing/planning for. Do you have an arbiter? I would read through the mirroring docs which discuss the various options available to you and the various automatic responses that mirroring can take (including some diagrams).

https://cedocs.intersystems.com/latest/csp/docbook/DocBook.UI.Page.cls?KEY=GHA_mirror

https://cedocs.intersystems.com/latest/csp/docbook/DocBook.UI.Page.cls?KEY=GHA_mirror#GHA_mirror_set_autofail_outages

If you want to simulate network isolation, I think you'd need to actually network isolate. If you force the backup to become primary, Caché will try to force down the original primary to prevent split brain.

0
Dan Pahnke  Mar 31, 2020 to Vic Sun

Thanks Vic,

What I was looking for was a way to, in effect, swap which member was primary and which was backup. Taking your advice and re-reading the Automatic Failover Mechanics section of the docs I've decided that there is no need for my test.

Thanks again.

Dan

0
Vic Sun  Mar 31, 2020 to Dan Pahnke

Happy to help! For what it's worth, best practice to initiate a failover would be to simply cleanly shut down the primary.

0
Mathew Lambert  Apr 29, 2020 to Vic Sun

Also when we are testing our scenarios we do phisically sometimes execute the network isolation amongst other tests

0
Pete Greskoff  May 20, 2020 to Andrew Makinson

That routine ultimately uses the same API under the covers: ##class(SYS.Mirror).BecomePrimary(), which forces down the original primary.

0