1

I'm going to use AlwaysOn technology on my servers, but it's some unclear points in the documentation:

Automatic failover looks like

  1. Primary replica (A) unaccessable
  2. Secondary replica (B) becomes first replica
  3. When A become available it sets to secondary replica and get all changes from primary replica (B)
  4. ???

in documentation is written that:

Later, when the server instance that is hosting the former primary replica restarts, it recognizes that another availability replica now owns the primary role. The former primary replica transitions to the secondary role, and its databases become secondary databases. The new secondary replica connects to the current primary replica and catches its database up to the current primary databases as quickly as possible. As soon as the new secondary replica has resynchronized its databases, failover is again possible, in the reverse direction.

Does it mean that former primary replica (A) will become primary replica automatically? Or it (A) will be secondary and failover in reverse direction must be done manually?

Thanks for your help

2

Does it mean that former primary replica (A) will become primary replica automatically?

No, all that means is when your replica comes back into the picture, and when the Availability Group database gets back in a SYNCHRONIZED state that it would be failover ready. That operation will not happen automatically. You indeed would have to either do this "failback" manually, or engineer a way to automate this (rather simple, let me know if you want to explore those options).

From a high-level view, your listing of steps is complete after step #3.

  • Thank you for your answer. Could you also tell me the way I can do it automatically? – MikkaRin Apr 16 '14 at 14:47
  • You could have some scheduled job that polls for the desired primary as a secondary in SYNCHRONIZED state, and if that's the case then failover. Just realize that this unnecessary failover could and would be an interruption in service of the database. – Thomas Stringer Apr 16 '14 at 18:01

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.