1

We have a SQL Server Enterprise 2017. I would like to get insights as to why our SERVERPROPERTY('HadrManagerStatus')returns 1 even if Always On is not configured in this instance.

I have a local instance in my work machine that is a stand alone. When I run SELECT SERVERPROPERTY('HadrManagerStatus') it returns 1 even if I have not set up Always On on this machine. Never have attempted to check the "Enable Always ON" box on the Service in the SQL server Configuration Manager.

I have setup this instance to be a publisher and a distributor for Replication. I have restored databases on this instance that the database were part of the availability databases.

I guess my question is, how does this SERVERPROPERTY('HadrManagerStatus') evaluates? What conditions does it check?

  • Looks like this may just be a change to the default as it is set to 1 on my servers and I haven't changed it. – Tony Hinkle Sep 13 '19 at 14:30
  • @TonyHinkle You dont have Always On setup on your instance as well? What do you mean change to the default? – Keith Rivera Sep 13 '19 at 14:37
  • No, we don't have any any 2017 clusters yet. I'm suggesting that the default value for 2012-2016 was 0, and the default for for 2017 is 1. – Tony Hinkle Sep 13 '19 at 14:43
  • 4
    You should check IsHadrEnabled and not HadrManagerStatus. to see if AlwaysON feature is enabled or not. – Kin Shah Sep 13 '19 at 14:53
  • 2
    Think of HadrManagerStatus as the gateway to IsHadrEnabled. The former is just what makes the latter (and Availability Groups) possible. – Aaron Bertrand Sep 13 '19 at 15:33
3

As mentioned in a comment by Kin, if you want to check on whether the "Enable Always On" checkbox is checked in SQL Server Configuration Manager, you should be using this property instead:

SELECT SERVERPROPERTY('IsHadrEnabled');

From the docs on IsHadrEnabled:

Always On availability groups is enabled on this server instance.

Regarding the other setting (HadrManagerStatus), here's what docs has to say:

Indicates whether the Always On availability groups manager has started.

I don't really know what the "Availability Groups manager" is, but it sounds like probably an internal component to SQL Server.

Tony helpfully pointed out that this value was non-zero on non-AG instances prior to 2017. I just verified this on a SQL Server 2016 instance where AGs are not enabled and set up, and I get "2" ("Not started and failed").

I'm speculating here, but the fact that the "AG manager" component is started by default on SQL Server 2017 probably has something to do with the clusterless, "read-scale" AG feature introduced in that version. So on 2017 this component is able to start up and run, whereas previous versions noticed the lack of WSFC and failed to start.

Anyway, that's just a guess. Maybe someone from Microsoft will come by and confirm one way or the other. The real answer is what Kin pointed out - if you want to check for AG's being enabled, use IsHadrEnabled.

  • IsHadrEnabled does fit for our needs. Thanks. What is weird is that I have 2 local instances in my workstation. Instance1 is the publisher and distributor for replication which returns 1 when i run the HadrManagerStatus. Instance2 on my machine however returns 0 when i run the query. Instance2 is basically my subscriber for my replication, and thats really all there is for my Instance2. Same machine. No failover cluster configured. Never have messed with AOAG for both. – Keith Rivera Sep 13 '19 at 16:10

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.