Why does sys.dm_hadr_cluster return a row on SQL 22 on Linux when AlwaysOn is enabled?

Brandon Tucker 6 Reputation points
2023-02-02T18:34:09.6133333+00:00

Hi folks-

I have a SQL 22 on Windows instance and a SQL 22 on Linux instance. I have enabled AlwaysOn on both and created a read-scale/clusterless AG that spans the two. When I query sys.dm_hadr_cluster on Linux, I receive the following result:

cluster_name = '' (blank)

quorum_type = 0 (Node Majority)

quorum_state = 1 (Normal quorum)

Is this expected or possibly a bug?

SQL Server
SQL Server
A family of Microsoft relational database management and analysis systems for e-commerce, line-of-business, and data warehousing solutions.
12,654 questions
{count} votes

3 answers

Sort by: Most helpful
  1. Erland Sommarskog 100.8K Reputation points MVP
    2023-02-07T08:11:42.13+00:00

    I tried this at two servers at my client, both running Windows Server 2016. None of them are in a Windows cluster as far as I know.

    On both, I get one row back from sys.dm_hadr_cluster on the default instance. The test server has a couple of named instances, and interesting the DMV came out empty when I tried the query on a named instance.

    I guess that SQL Server just calls a Windows API, and if that API returns something, the information is relayed. Since there is no clustering support on a workstation OS, the API is empty on a workstation OS.

    1 person found this answer helpful.

  2. Erland Sommarskog 100.8K Reputation points MVP
    2023-02-02T22:11:03.0333333+00:00

    I see the same thing on a machine running Windows Server 2016 and SQL 2017 on which I have a clusterless AG.

    I would say that is quite expected. Normally, with an AG, you do have a cluster, so I guess they display one row here to match regular AGs.


  3. Seeya Xi-MSFT 16,436 Reputation points
    2023-02-03T09:22:18.75+00:00

    Hi @Brandon Tucker ,

    Yes. Since there is no cluster behind the scenes, there is no concept of health checks and hence no automatic failovers and there is no problem with your result.

    You should focus on something else. Please read this blog: https://www.sqlshack.com/read-scale-availability-group-in-a-clusterless-availability-group/

    Best regards,

    Seeya


    If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".

    0 comments No comments