Blog Post

SQL Server Blog
4 MIN READ

Introducing Pacemaker HA Agent v2 for SQL Server on Linux (In Preview)

Attinder_Pal_Singh's avatar
Apr 03, 2026

We are excited to introduce the next generation of High Availability (HA) Agent for SQL Server on Linux: Pacemaker HA Agent v2. This release is a major step forward, designed to reduce planned and unplanned failover times, compared to the previous agent, based on internal engineering improvements. 

Why Pacemaker Is Required for SQL Server HA on Linux

For users new to Linux, it’s important to understand how high availability works on this platform.

On Windows, SQL Server AlwaysOn Availability Groups rely on Windows Server Failover Clustering (WSFC) to:

  • Monitor node health
  • Detect failures
  • Orchestrate automatic failovers

SQL Server AlwaysOn Availability Groups on Linux rely on an external cluster orchestrator for health monitoring and failover coordination, with Pacemaker HA Agent being one of the cluster orchestrators, responsible for:

  • Monitoring node and application health
  • Coordinating failover decisions
  • Helping mitigate split‑brain scenarios through improved write‑lease evaluation
  • Managing resources such as Availability Groups and listeners

The Pacemaker HA Agent is the integration layer that allows Pacemaker to understand SQL Server health and manage Availability Groups safely.

Evolution of the SQL Server Pacemaker HA Agent

With SQL Server 2025 CU3 and later, Pacemaker HA Agent v2 is available in preview for Red Hat Enterprise Linux and Ubuntu through the mssql-server-ha package. 

Pacemaker HA agent v2 uses a service‑based architecture. The agent runs as a dedicated system service named mssql-pcsag, which is responsible for handling SQL Server–specific high availability operations and communication with Pacemaker.

You can manage mssql-pcsag service by using standard system service controls to start, restart, status and stop this service by using the operating system's service manager (for example, systemctl).

# Start the mssql-pcsag service 
sudo systemctl start mssql-pcsag 

# Restart the mssql-pcsag service 
sudo systemctl restart mssql-pcsag 

# Check the status of the mssql-pcsag service 
sudo systemctl status mssql-pcsag 

# Stop the mssql-pcsag service 
sudo systemctl stop mssql-pcsag

 

 

 

 

 

 

 

Limitations of Pacemaker HA Agent v1

While the original agent enabled SQL Server HA on Linux, customers running production workloads encountered several challenges:

  • Failover delays of 30 seconds to 2 minutes during planned or unplanned events
  • Limited health detection, missing conditions such as I/O stalls and memory pressure
  • Rigid failover behavior, unlike the flexible policies available on Windows (WSFC)
  • Incomplete write‑lease handling, requiring custom logic
  • No support for TLS1.3 for Pacemaker and SQL Server communications

How Pacemaker HA Agent v2 Addresses These Gaps

Pacemaker HA Agent v2 is a ground‑up improvement, designed to improve the reliability characteristics of SQL Server HA on Linux.

1. Faster & Smarter Failover Decisions

The new agent introduces a service‑based health monitoring architecture, moving beyond basic polling. This allows SQL Server to report detailed diagnostic signals - improving detection speed and helping reduce failover delays in supported configurations.

2. Flexible Automatic Failover Policies inspired by the WSFC health model

Pacemaker HA Agent v2 supports failure‑condition levels (1–5) and health‑check timeout model aligned with those available in AlwaysOn Availability Groups on Windows.

This provides:

  • Fine‑grained control over failover sensitivity, allowing administrators to tune when failover should occur.
  • Improved detection of internal SQL Server conditions, such as memory pressure, internal deadlocks, orphaned spinlocks, and other engine‑level failures.

Failover decisions are now driven by detailed diagnostics from sp_server_diagnostics, enabling faster and more accurate response to unhealthy states and providing enhanced resiliency capabilities for SQL Server AG on Linux.

You can configure the failure condition level and health check timeout using the following commands:

-- Setting failure condition level 
ALTER AVAILABILITY GROUP pacemakerag SET (FAILURE_CONDITION_LEVEL = 2);
-- Setting health check timeout 
ALTER AVAILABILITY GROUP pacemakerag SET (HEALTH_CHECK_TIMEOUT = 60000);

After applying the configuration, validate the setting using the sys.availability_groups DMV:

 

 

 

 

3. Robust Write Lease Validity Handling

To prevent split‑brain scenarios, SQL Server on Linux uses an external write‑lease mechanism.

  • In v1, lease information was not fully integrated into failover decisions.
  • In v2, the agent actively evaluates the write-lease validity, before initiating transitions. This supports controlled role changes and improved data consistency behavior during failover events, depending on cluster configuration.

4. TLS 1.3 Support

Pacemaker HA agent v2 includes design updates to support TLS 1.3–based communication for health checks and failover operations, when TLS 1.3 is enabled.

Supported Versions & Distributions

Pacemaker HA Agent v2 supports:

  • SQL Server 2025 CU3 or later
  • RHEL 9 or later
  • Ubuntu 22.04 or higher.

Preview upgrade & migration guidance for non-production environments

New or existing non-prod deployments running SQL Server 2025 (17.x) can migrate from Pacemaker HA Agent v1 to v2 using following approach:

  • Drop the existing AG resource
sudo pcs resource delete <NameForAGResource>

This temporarily pauses AG synchronization but does not delete the Availability Group (AG). After the resource is recreated, Pacemaker resumes management and AG synchronization automatically.

  • Create a new AG resource using the v2 agent (ocf:mssql:agv2)
sudo pcs resource create <NameForAGResource> ocf:mssql:agv2 ag_name=<AGName> meta failure-timeout=30s promotable notify=true
  • Validate cluster health
sudo pcs status
  • Resume normal operations

References

Create and Configure an Availability Group for SQL Server on Linux - SQL Server | Microsoft Learn

Thank You,

Engineering: David Liao

Attinder Pal Singh

Updated Apr 03, 2026
Version 2.0