sys.dm_os_cluster_nodes#
Returns one row for each node of a two-node Querona cluster. On an installation that is not a cluster node the view returns no rows, as it does on a SQL Server instance that is not a failover cluster instance.
The rows are the nodes the Cluster page of the Administrative Portal shows, judged by the same rules, so the two never disagree on which node is up and which one serves. They name the nodes differently: the page by the agent instance and the host the instance is bound to, the view by the host name the node reports. Every query reads the state of both nodes from the metabase once; it never connects to the other node.
Column name |
Data type |
Nullable |
Description |
|---|---|---|---|
|
nvarchar(128) |
Yes |
The name of the machine the node runs on, as the node reports
it. |
|
int |
Yes |
|
|
varchar(7) |
No |
|
|
bit |
Yes |
|
Remarks#
A node is up while it has written its state to the metabase within the lease TTL (30 seconds by default, see qua_cluster_set_timings), and down after that. A node that has never written its state is down. Both the time a node writes its state and the time the view reads it come from the clock of the metabase server, so the clocks of the nodes do not affect the result.
is_current_owner follows the lease, not the status: a serving node that stopped reporting stays the owner, shown as
down, until the other node takes the serving role over. While a planned failover has released the lease, neither node
is the owner.
The rows are listed in the order of the nodes’ agent instance ids.
When the metabase does not answer - while it fails over, for example - the query fails with a message that names the reason; run it again.
Differences from SQL Server#
SQL Server reports the nodes of the Windows Server Failover Cluster that can own the failover cluster instance, and it can also report
2(paused),3(joining) and-1(unknown). Querona reports only0and1.SQL Server never reports a node that is down as the owner; Querona does until the other node takes the serving role over, as described above.
The documentation of SQL Server declares
status_descriptionasnvarchar(20); SQL Server itself returnsvarchar(7)not null, and Querona returns the same.SQL Server 2022 and later require
VIEW SERVER PERFORMANCE STATE; Querona requiresVIEW SERVER STATE.
Permissions#
Requires the VIEW SERVER STATE permission.
Examples#
SELECT NodeName, status, status_description, is_current_owner
FROM sys.dm_os_cluster_nodes;
On the serving node of a healthy cluster this returns two rows with status_description = 'up', one of them with
is_current_owner = 1.