Always-on Cluster : isalive check vs leasetimeout

sakuraime 2,321 Reputation points
2021-07-12T07:58:18.227+00:00

SQL Server AAG has a resource register at Windows failover cluster . This resource, has isalive check and also leasetimeout check . What about the difference between two ?

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,716 questions
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. CathyJi-MSFT 21,096 Reputation points Microsoft Vendor
    2021-07-12T09:20:50.007+00:00

    Hi @sakuraime ,

    Is-Alive mechanism

    The Is-Alive check is between WSFC and SQL Server. The SQL Server Always on resource DLL uses the sp_server_diagnostics stored procedure for the health of SQL Service. The stored procedure reports the status for the system, resource, IO subsystem, query processing and events. It uses a FAILURE_CONDITION_LEVEL for implementing defining a condition in which automatic failover can happen.

    Lease Timeout

    The Lease Timeout is between the SQL Server resource and SQL Server Availability Group. The lease is a simple handshake between the resource DLL and the SQL Server instance supporting the AG on the same node.

    Refer to below links.

    Lease Timeouts and Health Checks in SQL Server Always On Availability Groups
    How It Works: SQL Server AlwaysOn Lease Timeout


    If the response is helpful, please click "Accept Answer" and upvote it, as this could help other community members looking for similar queries.


  2. CathyJi-MSFT 21,096 Reputation points Microsoft Vendor
    2021-07-14T09:38:52.357+00:00

    Hi @sakuraime ,

    Before SQL 2012, what Isalive did was very simple. The Windows cluster service would use TCP/IP or Named Pipes to connect to the SQL Server cluster instance. After connecting, run a command "select @@servername".

    The SQL Server 2012 cluster uses a brand new Resource DLL (the name is still sqsrvres.dll). In the new Resource DLL, the looksalive check basically maintains its original function, but the Isalive check method has changed. The new Isalive not only relies on checking the connectivity between the cluster service and SQL Server to judge the health of SQL Server, it also relies on SQL Server for internal self-diagnosis and reports the diagnosis results to Resource DLL. The new Resource DLL instead executes a brand new stored procedure "sp_server_diagnostics" to perform Isalive checks to determine the health of the server.


    If the response is helpful, please click "Accept Answer" and upvote it, as this could help other community members looking for similar queries.