SQL Server Availability Groups – Notification When New Database is Added

availability-groupssql server

When new DB is added to SQL Server's AG setup, a notification email like below is sent to us.

The availability group database "XXXX" is changing roles from "SECONDARY" to "SECONDARY" because the mirroring session or availability group failed over due to role synchronization. This is an informational message only.

What is confusing is the phrase

"changing roles from "SECONDARY" to "SECONDARY" …"

  1. Can someone please decode the meaning of it?
  2. Is it normal that a notification of such is sent when new DBs are added or am I doing it wrong or any other issues ?

–In 'thoughts'…

Best Answer

...a notification email like below is sent to us

Sounds like you have alerts set up for error number 1480. This is a good thing to have on systems that use Availability Groups.

Can someone please decode the meaning of it?

When the message says "SECONDARY" to "SECONDARY" like that, it normally means there was just a brief disconnect between the PRIMARY and the SECONDARY, and the connection was re-established just before the error was raised. It's essentially bad timing.

Is it normal that a notification of such is sent when new DBs are added or am I doing it wrong or any other issues ?

I wouldn't call it "normal" but I don't think it's a cause for alarm, or something that you're explicitly causing. I have heard that this can happen from time to time, especially on VMs with low core counts (1-3 cores).

I've personally experienced this more when adding a database to an AG with automatic seeding turned on. I haven't seen any problems arise related to this no-op "failover" message.